Documentation ¶
Index ¶
- type AMILookup
- type Scope
- type Service
- func (s *Service) CreateInstance(scope *scope.MachineScope, userData []byte) (*infrav1.Instance, error)
- func (s *Service) DeleteBastion() error
- func (s *Service) DetachSecurityGroupsFromNetworkInterface(groups []string, interfaceID string) error
- func (s *Service) GetConsoleOutput(instanceID string) (string, error)
- func (s *Service) GetCoreSecurityGroups(scope *scope.MachineScope) ([]string, error)
- func (s *Service) GetInstanceSecurityGroups(instanceID string) (map[string][]string, error)
- func (s *Service) GetRunningInstanceByTags(scope *scope.MachineScope) (*infrav1.Instance, error)
- func (s *Service) InstanceIfExists(id *string) (*infrav1.Instance, error)
- func (s *Service) ReconcileBastion() error
- func (s *Service) SDKToInstance(v *ec2.Instance) (*infrav1.Instance, error)
- func (s *Service) TerminateInstance(instanceID string) error
- func (s *Service) TerminateInstanceAndWait(instanceID string) error
- func (s *Service) UpdateInstanceSecurityGroups(instanceID string, ids []string) error
- func (s *Service) UpdateResourceTags(resourceID *string, create, remove map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMILookup ¶ added in v0.5.4
AMILookup contains the parameters used to template AMI names used for lookup.
type Scope ¶ added in v0.5.5
type Scope interface { cloud.ClusterScoper // VPC returns the cluster VPC. VPC() *infrav1.VPCSpec // Subnets returns the cluster subnets. Subnets() infrav1.Subnets // Network returns the cluster network object. Network() *infrav1.Network // SecurityGroups returns the cluster security groups as a map, it creates the map if empty. SecurityGroups() map[infrav1.SecurityGroupRole]infrav1.SecurityGroup // Bastion returns the bastion details for the cluster. Bastion() *infrav1.Bastion // SetBastionInstance sets the bastion instance in the status of the cluster. SetBastionInstance(instance *infrav1.Instance) // SSHKeyName returns the SSH key name to use for instances. SSHKeyName() *string }
Scope is the interface for the scoep to be used with the ec2 service
type Service ¶
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 ¶
NewService returns a new service given the ec2 api client.
func (*Service) CreateInstance ¶
func (s *Service) CreateInstance(scope *scope.MachineScope, userData []byte) (*infrav1.Instance, error)
CreateInstance runs an ec2 instance.
func (*Service) DeleteBastion ¶
DeleteBastion deletes the Bastion instance
func (*Service) DetachSecurityGroupsFromNetworkInterface ¶ added in v0.4.1
func (s *Service) DetachSecurityGroupsFromNetworkInterface(groups []string, interfaceID string) error
DetachSecurityGroupsFromNetworkInterface looks up an ENI by interfaceID and detaches a list of Security Groups from that ENI.
func (*Service) GetConsoleOutput ¶
GetConsoleOutput returns the latest console output of an instance
func (*Service) GetCoreSecurityGroups ¶
func (s *Service) GetCoreSecurityGroups(scope *scope.MachineScope) ([]string, error)
GetCoreSecurityGroups looks up the security group IDs managed by this actuator They are considered "core" to its proper functioning
func (*Service) GetInstanceSecurityGroups ¶
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) GetRunningInstanceByTags ¶
GetRunningInstanceByTags returns the existing instance or nothing if it doesn't exist.
func (*Service) InstanceIfExists ¶
InstanceIfExists returns the existing instance or nothing if it doesn't exist.
func (*Service) ReconcileBastion ¶
ReconcileBastion ensures a bastion is created for the cluster
func (*Service) SDKToInstance ¶
SDKToInstance converts an AWS EC2 SDK instance to the CAPA instance type. 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 ¶
TerminateInstance terminates an EC2 instance. Returns nil on success, error in all other cases.
func (*Service) TerminateInstanceAndWait ¶
TerminateInstanceAndWait terminates and waits for an EC2 instance to terminate.
func (*Service) UpdateInstanceSecurityGroups ¶
UpdateInstanceSecurityGroups modifies the security groups of the given EC2 instance.
func (*Service) UpdateResourceTags ¶
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 |
---|---|
Run go generate to regenerate this mock.
|
Run go generate to regenerate this mock. |