Documentation ¶
Index ¶
- Variables
- func DeepEqual(a interface{}, b interface{}) bool
- func LookupExistingRecord(hostname *string) *route53.ResourceRecordSet
- func NewSession(awsconfig *aws.Config) *session.Session
- func Prettify(i interface{}) string
- type ACM
- type APICache
- type EC2
- type ELBV2
- func (e *ELBV2) AddListener(in elbv2.CreateListenerInput) (*elbv2.Listener, error)
- func (e *ELBV2) AddRule(in elbv2.CreateRuleInput) (*elbv2.Rule, error)
- func (e *ELBV2) AddTargetGroup(in elbv2.CreateTargetGroupInput) (*elbv2.TargetGroup, error)
- func (e *ELBV2) Create(in elbv2.CreateLoadBalancerInput) (*elbv2.LoadBalancer, error)
- func (e *ELBV2) Delete(in elbv2.DeleteLoadBalancerInput) error
- func (e *ELBV2) DescribeListeners(loadBalancerArn *string) ([]*elbv2.Listener, error)
- func (e *ELBV2) DescribeLoadBalancers(clusterName *string) ([]*elbv2.LoadBalancer, error)
- func (e *ELBV2) DescribeRules(listenerArn *string) ([]*elbv2.Rule, error)
- func (e *ELBV2) DescribeTags(arn *string) (util.Tags, error)
- func (e *ELBV2) DescribeTargetGroup(arn *string) (*elbv2.TargetGroup, error)
- func (e *ELBV2) DescribeTargetGroupTargets(arn *string) (util.AWSStringSlice, error)
- func (e *ELBV2) DescribeTargetGroups(loadBalancerArn *string) ([]*elbv2.TargetGroup, error)
- func (e *ELBV2) ModifyTargetGroup(in elbv2.ModifyTargetGroupInput) (*elbv2.TargetGroup, error)
- func (e *ELBV2) RegisterTargets(in elbv2.RegisterTargetsInput) error
- func (e *ELBV2) RemoveListener(in elbv2.DeleteListenerInput) error
- func (e *ELBV2) RemoveRule(in elbv2.DeleteRuleInput) error
- func (e *ELBV2) RemoveTargetGroup(in elbv2.DeleteTargetGroupInput) error
- func (e *ELBV2) SetSecurityGroups(in elbv2.SetSecurityGroupsInput) error
- func (e *ELBV2) SetSubnets(in elbv2.SetSubnetsInput) error
- func (e *ELBV2) UpdateTags(arn *string, old util.Tags, new util.Tags) error
- type IAM
- type Route53
- func (r *Route53) Delete(in route53.ChangeResourceRecordSetsInput) error
- func (r *Route53) DescribeResourceRecordSets(zoneID *string, hostname *string) (*route53.ResourceRecordSet, error)
- func (r *Route53) GetZoneID(hostname *string) (*route53.HostedZone, error)
- func (r *Route53) Modify(in route53.ChangeResourceRecordSetsInput) error
Constants ¶
This section is empty.
Variables ¶
var ( // Session is a pointer to the AWS session Session *session.Session // Route53svc is a pointer to the awsutil Route53 service Route53svc *Route53 // ALBsvc is a pointer to the awsutil ELBV2 service ALBsvc *ELBV2 // Ec2svc is a pointer to the awsutil EC2 service Ec2svc *EC2 // ACMsvc is a pointer to the awsutil ACM service ACMsvc *ACM // IAMsvc is a pointer to the awsutil IAM service IAMsvc *IAM // AWSDebug turns on AWS API debug logging AWSDebug bool // OnUpdateCount is a counter of the controller OnUpdate calls OnUpdateCount = prometheus.NewCounter(prometheus.CounterOpts{ Name: "albingress_updates", Help: "Number of times OnUpdate has been called.", }, ) // ReloadCount is a counter of the controller Reload calls ReloadCount = prometheus.NewCounter(prometheus.CounterOpts{ Name: "albingress_reloads", Help: "Number of times Reload has been called.", }, ) // AWSErrorCount is a counter of AWS errors AWSErrorCount = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "albingress_aws_errors", Help: "Number of errors from the AWS API", }, []string{"service", "request"}, ) // ManagedIngresses contains the current tally of managed ingresses ManagedIngresses = prometheus.NewGauge(prometheus.GaugeOpts{ Name: "albingress_managed_ingresses", Help: "Number of ingresses being managed", }) // AWSCache contains the hits and misses to our caches AWSCache = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "albingress_cache", Help: "Number of ingresses being managed", }, []string{"cache", "action"}) // AWSRequest contains the requests made to the AWS API AWSRequest = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "albingress_aws_requests", Help: "Number of requests made to the AWS API", }, []string{"service", "operation"}) )
Functions ¶
func DeepEqual ¶
func DeepEqual(a interface{}, b interface{}) bool
DeepEqual wraps github.com/aws/aws-sdk-go/aws/awsutil.Prettify. Preventing the need to import it in each package.
func LookupExistingRecord ¶
func LookupExistingRecord(hostname *string) *route53.ResourceRecordSet
LookupExistingRecord returns the route53.ResourceRecordSet for a hostname
func NewSession ¶
NewSession returns an AWS session based off of the provided AWS config
Types ¶
type ACM ¶
ACM is our extension to AWS's ACM.acm
func (*ACM) CertExists ¶
CertExists checks whether the provided ARN existing in AWS.
type APICache ¶
type APICache struct {
// contains filtered or unexported fields
}
type EC2 ¶
EC2 is our extension to AWS's ec2.EC2
func (*EC2) DescribeSecurityGroups ¶
func (e *EC2) DescribeSecurityGroups(in ec2.DescribeSecurityGroupsInput) ([]*ec2.SecurityGroup, error)
DescribeSecurityGroups looks up Security Groups based on input and returns a list of Security Groups.
func (*EC2) DescribeSubnets ¶
DescribeSubnets looks up Subnets based on input and returns a list of Subnets.
type ELBV2 ¶
type ELBV2 struct {
Svc elbv2iface.ELBV2API
}
ELBV2 is our extension to AWS's elbv2.ELBV2
func (*ELBV2) AddListener ¶
AddListener creates a new Listener and associates it with the ELBV2 (ALB). It returns the elbv2.Listener created on success or an error on failure.
func (*ELBV2) AddRule ¶
AddRule creates a new Rule and associates it with the Listener. It returns the elbv2.Rule created on success or an error returned on failure.
func (*ELBV2) AddTargetGroup ¶
func (e *ELBV2) AddTargetGroup(in elbv2.CreateTargetGroupInput) (*elbv2.TargetGroup, error)
AddTargetGroup creates a new TargetGroup in AWS. It returns the created elbv2.TargetGroup on success and an error on failure.
func (*ELBV2) Create ¶
func (e *ELBV2) Create(in elbv2.CreateLoadBalancerInput) (*elbv2.LoadBalancer, error)
Create makes a new ELBV2 (ALB) in AWS. It returns the elbv2.LoadBalancer created on success or an error on failure.
func (*ELBV2) Delete ¶
func (e *ELBV2) Delete(in elbv2.DeleteLoadBalancerInput) error
Delete removes an ELBV2 (ALB) in AWS. It returns an error if the delete fails. Deletions of ALBs in AWS will also remove all listeners and rules associated with them.
func (*ELBV2) DescribeListeners ¶
DescribeListeners looks up all ELBV2 (ALB) listeners in AWS that are part of the cluster.
func (*ELBV2) DescribeLoadBalancers ¶
func (e *ELBV2) DescribeLoadBalancers(clusterName *string) ([]*elbv2.LoadBalancer, error)
DescribeLoadBalancers looks up all ELBV2 (ALB) instances in AWS that are part of the cluster.
func (*ELBV2) DescribeRules ¶
DescribeRules looks up all rules for a listener ARN.
func (*ELBV2) DescribeTags ¶
DescribeTags looks up all tags for a given ARN.
func (*ELBV2) DescribeTargetGroup ¶
func (e *ELBV2) DescribeTargetGroup(arn *string) (*elbv2.TargetGroup, error)
DescribeTargetGroup looks up a target group by an ARN.
func (*ELBV2) DescribeTargetGroupTargets ¶
func (e *ELBV2) DescribeTargetGroupTargets(arn *string) (util.AWSStringSlice, error)
DescribeTargetGroupTargets looks up target group targets by an ARN.
func (*ELBV2) DescribeTargetGroups ¶
func (e *ELBV2) DescribeTargetGroups(loadBalancerArn *string) ([]*elbv2.TargetGroup, error)
DescribeTargetGroups looks up all ELBV2 (ALB) target groups in AWS that are part of the cluster.
func (*ELBV2) ModifyTargetGroup ¶
func (e *ELBV2) ModifyTargetGroup(in elbv2.ModifyTargetGroupInput) (*elbv2.TargetGroup, error)
ModifyTargetGroup alters a Target Group in AWS. The modified elbv2.TargetGroup is returned on success and an error is returned on failure.
func (*ELBV2) RegisterTargets ¶
func (e *ELBV2) RegisterTargets(in elbv2.RegisterTargetsInput) error
RegisterTargets adds EC2 instances to a Target Group. It returns an error when unsuccessful.
func (*ELBV2) RemoveListener ¶
func (e *ELBV2) RemoveListener(in elbv2.DeleteListenerInput) error
RemoveListener removes a Listener from an ELBV2 (ALB) by deleting it in AWS. If the deletion attempt returns a elbv2.ErrCodeListenerNotFoundException, it's considered a success as the listener has already been removed. If removal fails for another reason, an error is returned.
func (*ELBV2) RemoveRule ¶
func (e *ELBV2) RemoveRule(in elbv2.DeleteRuleInput) error
RemoveRule removes a Rule from a listener by deleting it in AWS. If the deletion fails, an error is returned.
func (*ELBV2) RemoveTargetGroup ¶
func (e *ELBV2) RemoveTargetGroup(in elbv2.DeleteTargetGroupInput) error
RemoveTargetGroup removes a Target Group from AWS by deleting it. If the deletion fails, an error is returned. Often, a Listener that references the Target Group is still being deleted when this method is accessed. Thus, this method makes multiple attempts to delete the Target Group when it receives an elbv2.ErrCodeResourceInUseException.
func (*ELBV2) SetSecurityGroups ¶
func (e *ELBV2) SetSecurityGroups(in elbv2.SetSecurityGroupsInput) error
SetSecurityGroups updates the security groups attached to an ELBV2 (ALB). It returns an error when unsuccessful.
func (*ELBV2) SetSubnets ¶
func (e *ELBV2) SetSubnets(in elbv2.SetSubnetsInput) error
SetSubnets updates the subnets attached to an ELBV2 (ALB). It returns an error when unsuccessful.
type IAM ¶
IAM is our extension to AWS's IAM.iam
func (*IAM) CertExists ¶
CertExists checks whether the provided ARN exists in AWS.
type Route53 ¶
type Route53 struct { Svc route53iface.Route53API // contains filtered or unexported fields }
Route53 is our extension to AWS's route53.Route53
func NewRoute53 ¶
NewRoute53 returns a new Route53 based off of an AWS session
func (*Route53) Delete ¶
func (r *Route53) Delete(in route53.ChangeResourceRecordSetsInput) error
Delete removes a Route53 Resource Record Set from Route 53. When a route53.InvalidChangeBatch error is detected, it's considered a failure as the Route 53 record no longer exists in its current states (is likley already deleted). All other failures return an error.
func (*Route53) DescribeResourceRecordSets ¶
func (r *Route53) DescribeResourceRecordSets(zoneID *string, hostname *string) (*route53.ResourceRecordSet, error)
DescribeResourceRecordSets returns the route53.ResourceRecordSet for a zone & hostname
func (*Route53) GetZoneID ¶
func (r *Route53) GetZoneID(hostname *string) (*route53.HostedZone, error)
GetZoneID looks for the Route53 zone ID of the hostname passed to it. It iteratively looks up very possible domain combination the hosted zone could represent. The most qualified will always win. e.g. If your domain is 1.2.example.com and you have 2.example.com and example.com both as hosted zones Route 53, 2.example.com will always win.