ec2

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

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, kubeConfig 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) 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) 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