ec2

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IPProtocolTCP is how EC2 represents the TCP protocol in ingress rules
	IPProtocolTCP = "tcp"

	// IPProtocolUDP is how EC2 represents the UDP protocol in ingress rules
	IPProtocolUDP = "udp"

	// IPProtocolICMP is how EC2 represents the ICMP protocol in ingress rules
	IPProtocolICMP = "icmp"

	// IPProtocolICMPv6 is how EC2 represents the ICMPv6 protocol in ingress rules
	IPProtocolICMPv6 = "58"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service holds a collection of interfaces. The interfaces are broken down like this to group functions together. One alternative is to have a large list of functions from the ec2 client.

func NewService

func NewService(scope *actuators.Scope) *Service

NewService returns a new service given the ec2 api client.

func (*Service) CreateOrGetMachine

func (s *Service) CreateOrGetMachine(machine *actuators.MachineScope, bootstrapToken string) (*v1alpha1.Instance, error)

CreateOrGetMachine will either return an existing instance or create and return an instance.

func (*Service) DeleteBastion

func (s *Service) DeleteBastion() error

DeleteBastion deletes the Bastion instance

func (*Service) DeleteNetwork

func (s *Service) DeleteNetwork() (err error)

DeleteNetwork deletes the network of the given cluster.

func (*Service) GetConsoleOutput

func (s *Service) GetConsoleOutput(instanceID string) (string, error)

GetConsoleOutput returns the latest console output of an instance

func (*Service) GetCoreSecurityGroups added in v0.3.0

func (s *Service) GetCoreSecurityGroups(machine *actuators.MachineScope) ([]string, error)

func (*Service) GetInstanceSecurityGroups added in v0.3.0

func (s *Service) GetInstanceSecurityGroups(instanceID string) (map[string][]string, error)

GetInstanceSecurityGroups returns a map from ENI id to the security groups applied to that ENI While some security group operations take place at the "instance" level, these are in fact an API convenience for manipulating the first ("primary") ENI's properties.

func (*Service) InstanceByTags

func (s *Service) InstanceByTags(machine *actuators.MachineScope) (*v1alpha1.Instance, error)

InstanceByTags returns the existing instance or nothing if it doesn't exist.

func (*Service) InstanceIfExists

func (s *Service) InstanceIfExists(id *string) (*v1alpha1.Instance, error)

InstanceIfExists returns the existing instance or nothing if it doesn't exist.

func (*Service) MachineExists

func (s *Service) MachineExists(machine *actuators.MachineScope) (bool, error)

MachineExists will return whether or not a machine exists.

func (*Service) ReconcileBastion

func (s *Service) ReconcileBastion() error

ReconcileBastion ensures a bastion is created for the cluster

func (*Service) ReconcileNetwork

func (s *Service) ReconcileNetwork() (err error)

ReconcileNetwork reconciles the network of the given cluster.

func (*Service) SDKToInstance added in v0.2.1

func (s *Service) SDKToInstance(v *ec2.Instance) (*v1alpha1.Instance, error)

SDKToInstance converts an AWS EC2 SDK instance to the CAPA instance type. converters.SDKToInstance populates all instance fields except for rootVolumeSize, because EC2.DescribeInstances does not return the size of storage devices. An additional call to EC2 is required to get this value.

func (*Service) TerminateInstance

func (s *Service) TerminateInstance(instanceID string) error

TerminateInstance terminates an EC2 instance. Returns nil on success, error in all other cases.

func (*Service) TerminateInstanceAndWait

func (s *Service) TerminateInstanceAndWait(instanceID string) error

TerminateInstanceAndWait terminates and waits for an EC2 instance to terminate.

func (*Service) UpdateInstanceSecurityGroups

func (s *Service) UpdateInstanceSecurityGroups(instanceID string, ids []string) error

UpdateInstanceSecurityGroups modifies the security groups of the given EC2 instance.

func (*Service) UpdateResourceTags

func (s *Service) UpdateResourceTags(resourceID *string, create map[string]string, remove map[string]string) error

UpdateResourceTags updates the tags for an instance. This will be called if there is anything to create (update) or delete. We may not always have to perform each action, so we check what we're receiving to avoid calling AWS if we don't need to.

Directories

Path Synopsis
Package mock_ec2iface is a generated GoMock package.
Package mock_ec2iface is a generated GoMock package.

Jump to

Keyboard shortcuts

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