Documentation ¶
Overview ¶
Package asg provides a service for managing AWS AutoScalingGroups.
Index ¶
- func BuildTagsFromMap(asgName string, inTags map[string]string) []*autoscaling.Tag
- type Service
- func (s *Service) ASGIfExists(name *string) (*expinfrav1.AutoScalingGroup, error)
- func (s *Service) CanStartASGInstanceRefresh(scope *scope.MachinePoolScope) (bool, error)
- func (s *Service) CreateASG(machinePoolScope *scope.MachinePoolScope) (*expinfrav1.AutoScalingGroup, error)
- func (s *Service) DeleteASG(name string) error
- func (s *Service) DeleteASGAndWait(name string) error
- func (s *Service) GetASGByName(scope *scope.MachinePoolScope) (*expinfrav1.AutoScalingGroup, error)
- func (s *Service) ResumeProcesses(name string, processes []string) error
- func (s *Service) SDKToAutoScalingGroup(v *autoscaling.Group) (*expinfrav1.AutoScalingGroup, error)
- func (s *Service) StartASGInstanceRefresh(scope *scope.MachinePoolScope) error
- func (s *Service) SubnetIDs(scope *scope.MachinePoolScope) ([]string, error)
- func (s *Service) SuspendProcesses(name string, processes []string) error
- func (s *Service) UpdateASG(machinePoolScope *scope.MachinePoolScope) error
- func (s *Service) UpdateResourceTags(resourceID *string, create, remove map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTagsFromMap ¶
func BuildTagsFromMap(asgName string, inTags map[string]string) []*autoscaling.Tag
BuildTagsFromMap takes a map of keys and values and returns them as autoscaling group tags.
Types ¶
type Service ¶
type Service struct { ASGClient autoscalingiface.AutoScalingAPI EC2Client ec2iface.EC2API // 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 asg client.
func NewService ¶
func NewService(clusterScope cloud.ClusterScoper) *Service
NewService returns a new service given the asg api client.
func (*Service) ASGIfExists ¶
func (s *Service) ASGIfExists(name *string) (*expinfrav1.AutoScalingGroup, error)
ASGIfExists returns the existing autoscaling group or nothing if it doesn't exist.
func (*Service) CanStartASGInstanceRefresh ¶
func (s *Service) CanStartASGInstanceRefresh(scope *scope.MachinePoolScope) (bool, error)
CanStartASGInstanceRefresh will start an ASG instance with refresh.
func (*Service) CreateASG ¶
func (s *Service) CreateASG(machinePoolScope *scope.MachinePoolScope) (*expinfrav1.AutoScalingGroup, error)
CreateASG runs an autoscaling group.
func (*Service) DeleteASGAndWait ¶
DeleteASGAndWait will delete an ASG and wait until it is deleted.
func (*Service) GetASGByName ¶
func (s *Service) GetASGByName(scope *scope.MachinePoolScope) (*expinfrav1.AutoScalingGroup, error)
GetASGByName returns the existing ASG or nothing if it doesn't exist.
func (*Service) ResumeProcesses ¶
ResumeProcesses resumes the processes for an autoscaling group.
func (*Service) SDKToAutoScalingGroup ¶
func (s *Service) SDKToAutoScalingGroup(v *autoscaling.Group) (*expinfrav1.AutoScalingGroup, error)
SDKToAutoScalingGroup converts an AWS EC2 SDK AutoScalingGroup to the CAPA AutoScalingGroup type.
func (*Service) StartASGInstanceRefresh ¶
func (s *Service) StartASGInstanceRefresh(scope *scope.MachinePoolScope) error
StartASGInstanceRefresh will start an ASG instance with refresh.
func (*Service) SubnetIDs ¶
func (s *Service) SubnetIDs(scope *scope.MachinePoolScope) ([]string, error)
SubnetIDs return subnet IDs of a AWSMachinePool based on given subnetIDs and filters.
func (*Service) SuspendProcesses ¶
SuspendProcesses suspends the processes for an autoscaling group.
func (*Service) UpdateASG ¶
func (s *Service) UpdateASG(machinePoolScope *scope.MachinePoolScope) error
UpdateASG will update the ASG of a service.
func (*Service) UpdateResourceTags ¶
UpdateResourceTags updates the tags for an autoscaling group. 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_autoscalingiface is a generated GoMock package.
|
Package mock_autoscalingiface is a generated GoMock package. |