aws

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package aws provides some higher level Amazon Web Services abstractions for access to common resources.

The exported Adapter can be used to orchestrate and obtain information about Elastic Compute Cloud (EC2), EC2 Metadata, Elastic Load Balancing (ELB v2, also known as Application Load Balancer - ALB), and Auto Scaling (ASG).

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSecurityGroupNotFound is used to signal that the required security group couldn't be found.
	ErrMissingSecurityGroup = errors.New("required security group was not found")
	// ErrLoadBalancerNotFound is used to signal that a given load balancer was not found.
	ErrLoadBalancerNotFound = errors.New("load balancer not found")
	// ErrMissingNameTag is used to signal that the Name tag on a given resource is missing.
	ErrMissingNameTag = errors.New("Name tag not found")
	// ErrMissingTag is used to signal that a tag on a given resource is missing.
	ErrMissingTag = errors.New("missing tag")
	// ErrNoSubnets is used to signal that no subnets were found in the current VPC
	ErrNoSubnets = errors.New("unable to find VPC subnets")
	// ErrMissingAutoScalingGroupTag is used to signal that the auto scaling group tag is not present in the list of tags.
	ErrMissingAutoScalingGroupTag = errors.New(`instance is missing the "` + autoScalingGroupNameTag + `" tag`)
)

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

An Adapter can be used to orchestrate and obtain information from Amazon Web Services.

func NewAdapter

func NewAdapter(healthCheckPath string, healthCheckPort uint16) (*Adapter, error)

NewAdapter returns a new Adapter that can be used to orchestrate and obtain information from Amazon Web Services. Before returning there is a discovery process for VPC and EC2 details. It tries to find the TargetGroup and Security Group that should be used for newly created LoadBalancers. If any of those critical steps fail an appropriate error is returned.

func (*Adapter) AutoScalingGroupName

func (a *Adapter) AutoScalingGroupName() string

AutoScalingGroupName returns the name of the Auto Scaling Group the current node belongs to

func (*Adapter) ClusterID

func (a *Adapter) ClusterID() string

StackName returns the ClusterID tag that all resources from the same Kubernetes cluster share. It's taken from The current ec2 instance.

func (*Adapter) CreateLoadBalancer

func (a *Adapter) CreateLoadBalancer(certificateARN string) (*LoadBalancer, error)

CreateLoadBalancer creates a new Application Load Balancer with an HTTPS listener using the certificate with the certificateARN argument. It will forward all requests to the target group discovered by the Adapter.

func (*Adapter) DeleteLoadBalancer

func (a *Adapter) DeleteLoadBalancer(loadBalancer *LoadBalancer) error

func (*Adapter) FindLoadBalancerWithCertificateID

func (a *Adapter) FindLoadBalancerWithCertificateID(certificateARN string) (*LoadBalancer, error)

FindLoadBalancerWithCertificateID looks up for the first Application Load Balancer with, at least, 1 listener with the certificateARN. Order is not guaranteed and depends only on the AWS SDK result order.

func (*Adapter) FindManagedLoadBalancers

func (a *Adapter) FindManagedLoadBalancers() ([]*LoadBalancer, error)

FindManagedLoadBalancers returns all ALBs containing the controller management tags for the current cluster.

func (*Adapter) InstanceID

func (a *Adapter) InstanceID() string

InstanceID returns the instance ID the current node is running on.

func (*Adapter) PrivateSubnetIDs

func (a *Adapter) PrivateSubnetIDs() []string

PrivateSubnetIDs returns a slice with the private subnet IDs discovered by the adapter.

func (*Adapter) PublicSubnetIDs

func (a *Adapter) PublicSubnetIDs() []string

PublicSubnetIDs returns a slice with the public subnet IDs discovered by the adapter.

func (*Adapter) SecurityGroupID

func (a *Adapter) SecurityGroupID() string

SecurityGroupID returns the security group ID that should be used to create Load Balancers.

func (*Adapter) StackName

func (a *Adapter) StackName() string

StackName returns the Name tag that all resources created by the same CloudFormation stack share. It's taken from The current ec2 instance.

func (*Adapter) VpcID

func (a *Adapter) VpcID() string

VpcID returns the VPC ID the current node belongs to.

type LoadBalancer

type LoadBalancer struct {
	// contains filtered or unexported fields
}

LoadBalancer is a simple wrapper around an AWS Load Balancer details.

func (*LoadBalancer) ARN

func (lb *LoadBalancer) ARN() string

ARN returns the load balancer ARN.

func (*LoadBalancer) CertificateARN

func (lb *LoadBalancer) CertificateARN() string

func (*LoadBalancer) DNSName

func (lb *LoadBalancer) DNSName() string

DNSName returns the FQDN for the load balancer. It's usually prefixed by its Name.

func (*LoadBalancer) Name

func (lb *LoadBalancer) Name() string

Name returns the load balancer friendly name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL