asg

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package asg provides a service for managing AWS AutoScalingGroups.

Index

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) DeleteASG

func (s *Service) DeleteASG(name string) error

DeleteASG will delete the ASG of a service.

func (*Service) DeleteASGAndWait

func (s *Service) DeleteASGAndWait(name string) error

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

func (s *Service) ResumeProcesses(name string, processes []string) error

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

func (s *Service) SuspendProcesses(name string, processes []string) error

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

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

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.

Jump to

Keyboard shortcuts

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