Documentation
¶
Index ¶
- Constants
- func IsAttributeEmpty(err error) bool
- func IsClientNotInitialized(err error) bool
- func IsKMSKeyAliasEmpty(err error) bool
- func IsKeyPairCannotCreateAndNotFound(err error) bool
- func IsNoBucketInBucketObject(err error) bool
- func IsNotFound(err error) bool
- func IsNotImplementedMethod(err error) bool
- func IsResourceDelete(err error) bool
- func NewCustomExponentialBackoff() *backoff.ExponentialBackOff
- func NewNotify(logger micrologger.Logger, operationName string) func(error, time.Duration)
- type AWSEntity
- type Bucket
- type BucketObject
- type EC2StateCode
- type ELB
- type FSKeyPairProvider
- type FindInstancesInput
- type Gateway
- type HostedZone
- type Instance
- type InstanceProfile
- type KMSKey
- type KeyPair
- type KeyPairProvider
- type Policy
- type PortPair
- type PortPairs
- type RecordSet
- type RouteTable
- type SecurityGroup
- type SecurityGroupRule
- type Subnet
- type VPC
Constants ¶
const ( ELBType resourceType = "elb" HostedZoneType resourceType = "hosted zone" GatewayType resourceType = "gateway" InstanceType resourceType = "instance" RouteTableType resourceType = "route table" RouteType resourceType = "route" SecurityGroupType resourceType = "security group" SubnetType resourceType = "subnet" VPCType resourceType = "vpc" )
const ( RoleNameTemplate = "EC2-K8S-Role" PolicyNameTemplate = "EC2-K8S-Policy" ProfileNameTemplate = "EC2-K8S-Role" AssumeRolePolicyDocument = `` /* 163-byte string literal not displayed */ PolicyDocumentTempl = `` /* 481-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func IsAttributeEmpty ¶
IsPortsToOpenEmpty asserts portsToOpenEmptyError.
func IsClientNotInitialized ¶
IsClientNotInitialized asserts clientNotInitializedError.
func IsKMSKeyAliasEmpty ¶
IsKMSKeyAliasEmpty asserts kmsKeyAliasEmptyError.
func IsKeyPairCannotCreateAndNotFound ¶
IsKeyPairCannotCreateAndNotFound asserts keyPairCannotCreateAndNotFoundError.
func IsNoBucketInBucketObject ¶
IsNoBucketInBucketObject asserts noBucketInBucketObjectError.
func IsNotImplementedMethod ¶
IsNotImplementedMethod asserts notImplementedMethodError.
func IsResourceDelete ¶
IsResourceDelete asserts resourceDeleteError.
func NewCustomExponentialBackoff ¶
func NewCustomExponentialBackoff() *backoff.ExponentialBackOff
NewCustomExponentialBackoff returns pointer to a backoff.ExponentialBackOff, initialized with custom values. At the moment, we only override the MaxElapsedTime.
Types ¶
type BucketObject ¶
func (*BucketObject) CreateIfNotExists ¶
func (bo *BucketObject) CreateIfNotExists() (bool, error)
func (*BucketObject) CreateOrFail ¶
func (bo *BucketObject) CreateOrFail() error
func (*BucketObject) Delete ¶
func (bo *BucketObject) Delete() error
type EC2StateCode ¶
type EC2StateCode int
const ( // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#InstanceState EC2PendingState EC2StateCode = 0 EC2RunningState EC2StateCode = 16 EC2ShuttingDownState EC2StateCode = 32 EC2TerminatedState EC2StateCode = 48 EC2StoppingState EC2StateCode = 64 EC2StoppedState EC2StateCode = 80 )
type ELB ¶
type ELB struct { Name string AZ string SecurityGroup string SubnetID string Tags []string PortsToOpen PortPairs Client *elb.ELB // contains filtered or unexported fields }
ELB is an Elastic Load Balancer
func NewELBFromExisting ¶
NewELBFromExisting initializes an ELB struct with some fields retrieved from the API, such as its FQDN and its Hosted Zone ID. We need these fields when deleting a Record Set. This method doesn't create a new ELB on AWS.
func (*ELB) AssignProxyProtocolPolicy ¶
AssignProxyPolicy creates a ProxyProtocol policy and assigns it to the Load Balancer. This is needed for ELBs that listen/forward over TCP, in order to add a header with the address, port of the source and destination. Without this, `kubectl log/exec` don't work. See https://github.com/kubernetes/ingress/tree/4601775c18f5c6968e56e1eeaa26efc629590bb0/controllers/nginx#proxy-protocol
func (*ELB) CreateIfNotExists ¶
func (*ELB) CreateOrFail ¶
func (ELB) HostedZoneID ¶
func (*ELB) RegisterInstances ¶
type FSKeyPairProvider ¶
type FSKeyPairProvider struct {
// contains filtered or unexported fields
}
func NewFSKeyPairProvider ¶
func NewFSKeyPairProvider(pubKeyFile string) *FSKeyPairProvider
type FindInstancesInput ¶
type FindInstancesInput struct { Clients awsutil.Clients Logger micrologger.Logger Pattern string }
type Gateway ¶
type Gateway struct { Name string VpcID string // Dependencies. Logger micrologger.Logger AWSEntity // contains filtered or unexported fields }
func (*Gateway) CreateIfNotExists ¶
func (*Gateway) CreateOrFail ¶
type HostedZone ¶
type HostedZone struct { Name string Private bool Comment string Client *route53.Route53 // contains filtered or unexported fields }
func NewHostedZoneFromExisting ¶
func NewHostedZoneFromExisting(name string, client *route53.Route53) (*HostedZone, error)
NewHostedZoneFromExisting initializes a Hosted Zone, setting some fields it has retrieved from an existing HZ It's used when deleting a RecordSet. It does not create a new HZ on AWS.
func (*HostedZone) CreateIfNotExists ¶
func (hz *HostedZone) CreateIfNotExists() (bool, error)
func (*HostedZone) CreateOrFail ¶
func (hz *HostedZone) CreateOrFail() error
func (HostedZone) Delete ¶
func (hz HostedZone) Delete() error
func (HostedZone) GetID ¶
func (hz HostedZone) GetID() string
type Instance ¶
type Instance struct { Name string ClusterName string ImageID string InstanceType string KeyName string MinCount int MaxCount int UserData string SmallCloudconfig string IamInstanceProfileName string PlacementAZ string SecurityGroupID string SubnetID string // Dependencies. Logger micrologger.Logger AWSEntity // contains filtered or unexported fields }
func FindInstances ¶
func FindInstances(input FindInstancesInput) ([]*Instance, error)
func (*Instance) CreateIfNotExists ¶
func (*Instance) CreateOrFail ¶
type InstanceProfile ¶
type InstanceProfile struct { ClusterID string AWSEntity // contains filtered or unexported fields }
func (*InstanceProfile) CreateIfNotExists ¶
func (ip *InstanceProfile) CreateIfNotExists() (bool, error)
func (*InstanceProfile) CreateOrFail ¶
func (ip *InstanceProfile) CreateOrFail() error
func (*InstanceProfile) Delete ¶
func (ip *InstanceProfile) Delete() error
func (InstanceProfile) GetName ¶
func (ip InstanceProfile) GetName() string
type KeyPair ¶
type KeyPair struct { ClusterName string Provider KeyPairProvider AWSEntity }
func (*KeyPair) CreateIfNotExists ¶
func (*KeyPair) CreateOrFail ¶
type KeyPairProvider ¶
type KeyPairProvider interface {
// contains filtered or unexported methods
}
type Policy ¶
type Policy struct { ClusterID string KMSKeyArn string S3Bucket string AWSEntity // contains filtered or unexported fields }
func (*Policy) CreateIfNotExists ¶
func (*Policy) CreateOrFail ¶
type PortPair ¶
type PortPair struct { // PortELB is the port the ELB should listen on. PortELB int // PortInstance is the port on the instance the ELB forwards traffic to. PortInstance int }
PortPair is a pair of ports.
type RecordSet ¶
type RecordSet struct { // Domain is the domain name for the record. Domain string // HostedZoneID is the ID of the Hosted Zone the record should be created in. HostedZoneID string // Client is the AWS client. Client *route53.Route53 // Resource is the AWS resource the record should be created for. Resource resources.DNSNamedResource }
func (RecordSet) CreateIfNotExists ¶
CreateIfNotExists is not implemented because AWS provides UPSERT functionality for DNS records
func (RecordSet) CreateOrFail ¶
type RouteTable ¶
type RouteTable struct { Name string VpcID string Client *ec2.EC2 // contains filtered or unexported fields }
func (*RouteTable) CreateIfNotExists ¶
func (r *RouteTable) CreateIfNotExists() (bool, error)
func (*RouteTable) CreateOrFail ¶
func (r *RouteTable) CreateOrFail() error
func (*RouteTable) Delete ¶
func (r *RouteTable) Delete() error
func (RouteTable) GetID ¶
func (r RouteTable) GetID() (string, error)
func (RouteTable) MakePublic ¶
func (r RouteTable) MakePublic() error
MakePublic creates a route that allows traffic from outside the VPC. To do that, it needs to add a route on the Internet Gateway of the VPC.
type SecurityGroup ¶
type SecurityGroup struct { Description string GroupName string VpcID string Rules []SecurityGroupRule AWSEntity // contains filtered or unexported fields }
func (SecurityGroup) ApplyRules ¶
func (s SecurityGroup) ApplyRules(rules []SecurityGroupRule) error
func (*SecurityGroup) CreateIfNotExists ¶
func (s *SecurityGroup) CreateIfNotExists() (bool, error)
func (*SecurityGroup) CreateOrFail ¶
func (s *SecurityGroup) CreateOrFail() error
func (*SecurityGroup) Delete ¶
func (s *SecurityGroup) Delete() error
func (SecurityGroup) GetID ¶
func (s SecurityGroup) GetID() (string, error)
type SecurityGroupRule ¶
type SecurityGroupRule struct { Port int // SourceCIDR is the CIDR of the source. SourceCIDR string // SecurityGroupID is the ID of the source Security Group. SecurityGroupID string }
SecurityGroupRule is an AWS security group rule.
type Subnet ¶
type Subnet struct { AvailabilityZone string CidrBlock string Name string VpcID string // Dependencies. Logger micrologger.Logger AWSEntity // contains filtered or unexported fields }
func (*Subnet) CreateIfNotExists ¶
func (*Subnet) CreateOrFail ¶
func (*Subnet) MakePublic ¶
func (s *Subnet) MakePublic(routeTable *RouteTable) error
type VPC ¶
type VPC struct { CidrBlock string Name string AWSEntity // contains filtered or unexported fields }