autoscaling

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 22 Imported by: 0

README

Auto Scaling

Parity grade: A · SDK aws-sdk-go-v2/service/autoscaling@v1.64.2 · last audited 2026-07-12 (d125027b)

Coverage

Metric Value
Operations audited 66 (66 ok)
Known gaps 7
Deferred items 2
Resource leaks clean
Known gaps
  • ASG->EC2 real instance provisioning is simulated only (Instance is a fake record, not backed by an ec2 resource) (bd: gopherstack-8sk) - NOT fixed this pass per scope
  • ASG/ECS->ELBv2 target registration is simulated only (TargetGroupARNs/LoadBalancerNames are stored but never actually register targets with elbv2) (bd: gopherstack-18k) - NOT fixed this pass per scope
  • Scheduled actions (Put/BatchPut) now correctly persist StartTime/EndTime/Recurrence, but there is no background scheduler goroutine that actually executes them at the scheduled time/cron - Describe reflects what was requested, but nothing fires it. Filed as gopherstack-6ys for follow-up; deliberately not attempted this pass (a correct cron-parsing+ticker engine is a separate, sizable feature, not a quick wire fix, and getting it wrong risks a new leak class)
  • Multiple lifecycle hooks of the same transition on one group: this simulation gates on a single (deterministic, lowest-named) hook per transition per group, matching the common case; AWS supports N hooks per transition each independently gating the same instance. Documented simplification, see Notes
  • ABANDON on a launch hook terminates the pending instance but does not attempt an automatic relaunch to restore DesiredCapacity (real AWS does retry); documented simplification, see Notes
  • GetPredictiveScalingForecast returns a real, well-shaped, non-empty forecast, but it is a flat naive projection (current DesiredCapacity repeated hourly), not a statistical model - genuinely out of scope for an emulator; documented simplification, see Notes
  • CreateAutoScalingGroupInput fields not wired up: AvailabilityZoneDistribution, AvailabilityZoneImpairmentPolicy, CapacityReservationSpecification, DeletionProtection, InstanceLifecyclePolicy, InstanceMaintenancePolicy, SkipZonalShiftValidation (all newer/niche SDK additions); not attempted this pass - deferred, no bd id filed yet (low real-world usage relative to MixedInstancesPolicy/LifecycleHookSpecificationList, which WERE fixed)
Deferred
  • InstanceRequirements-based MixedInstancesPolicy overrides (attribute-based instance selection) - only InstanceType-based overrides are parsed/returned
  • PredictiveScalingConfiguration (Put/Describe are not in GetSupportedOperations at all - predictive scaling policy configuration management, as opposed to GetPredictiveScalingForecast, was out of scope for this pass; confirmed the SDK op list has no separate op for this, it rides inside PutScalingPolicy's PolicyType=PredictiveScaling with a nested config this handler does not parse)

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrGroupNotFound is returned when the requested Auto Scaling group does not exist.
	ErrGroupNotFound = errors.New("AutoScalingGroupNotFound")
	// ErrGroupAlreadyExists is returned when an Auto Scaling group with that name already exists.
	ErrGroupAlreadyExists = errors.New("AlreadyExists")
	// ErrLaunchConfigurationNotFound is returned when a launch configuration does not exist.
	ErrLaunchConfigurationNotFound = errors.New("LaunchConfigurationNotFound")
	// ErrLaunchConfigurationAlreadyExists is returned when a launch configuration already exists.
	ErrLaunchConfigurationAlreadyExists = errors.New("AlreadyExists")
	// ErrUnknownAction is returned when the requested action is not recognized.
	ErrUnknownAction = errors.New("InvalidAction")
	// ErrInvalidParameter is returned when a request parameter is invalid.
	ErrInvalidParameter = errors.New("ValidationError")
	// ErrActiveInstanceRefreshNotFound is returned when no active instance refresh exists.
	ErrActiveInstanceRefreshNotFound = errors.New("ActiveInstanceRefreshNotFound")
	// ErrLifecycleHookNotFound is returned when the specified lifecycle hook does not exist.
	ErrLifecycleHookNotFound = errors.New("ValidationError")
	// ErrScalingActivityInProgress is returned when a delete is attempted on a group with active instances
	// and ForceDelete is not set.
	ErrScalingActivityInProgress = errors.New("ScalingActivityInProgress")
	// ErrInstanceNotFound is returned when a specific instance ID is not found in an ASG.
	ErrInstanceNotFound = errors.New("ValidationError")
	// ErrWarmPoolNotFound is returned when no warm pool exists for the group.
	ErrWarmPoolNotFound = errors.New("ValidationError")
	// ErrPolicyNotFound is returned when the specified scaling policy does not exist.
	ErrPolicyNotFound = errors.New("ValidationError")
)

Functions

This section is empty.

Types

type AccountLimits

type AccountLimits struct {
	MaxNumberOfAutoScalingGroups    int32 `json:"MaxNumberOfAutoScalingGroups"`
	MaxNumberOfLaunchConfigurations int32 `json:"MaxNumberOfLaunchConfigurations"`
	NumberOfAutoScalingGroups       int32 `json:"NumberOfAutoScalingGroups"`
	NumberOfLaunchConfigurations    int32 `json:"NumberOfLaunchConfigurations"`
}

AccountLimits represents AWS Auto Scaling account limits.

type AutoScalingGroup

type AutoScalingGroup struct {
	CreatedTime                      time.Time                    `json:"CreatedTime"`
	LastScalingActivity              time.Time                    `json:"LastScalingActivity,omitzero"`
	AutoScalingGroupName             string                       `json:"AutoScalingGroupName"`
	Status                           string                       `json:"Status,omitempty"`
	HealthCheckType                  string                       `json:"HealthCheckType"`
	LaunchConfigurationName          string                       `json:"LaunchConfigurationName,omitempty"`
	AutoScalingGroupARN              string                       `json:"AutoScalingGroupARN"`
	VPCZoneIdentifier                string                       `json:"VPCZoneIdentifier,omitempty"`
	PlacementGroup                   string                       `json:"PlacementGroup,omitempty"`
	Context                          string                       `json:"Context,omitempty"`
	DesiredCapacityType              string                       `json:"DesiredCapacityType,omitempty"`
	LaunchTemplate                   *LaunchTemplateSpecification `json:"LaunchTemplate,omitempty"`
	MixedInstancesPolicy             *MixedInstancesPolicy        `json:"MixedInstancesPolicy,omitempty"`
	LoadBalancerNames                []string                     `json:"LoadBalancerNames,omitempty"`
	TargetGroupARNs                  []string                     `json:"TargetGroupARNs,omitempty"`
	TrafficSources                   []TrafficSource              `json:"TrafficSources,omitempty"`
	AvailabilityZones                []string                     `json:"AvailabilityZones,omitempty"`
	Instances                        []Instance                   `json:"Instances,omitempty"`
	Tags                             []Tag                        `json:"Tags,omitempty"`
	SuspendedProcesses               []string                     `json:"SuspendedProcesses,omitempty"`
	EnabledMetrics                   []string                     `json:"EnabledMetrics,omitempty"`
	TerminationPolicies              []string                     `json:"TerminationPolicies,omitempty"`
	MinSize                          int32                        `json:"MinSize"`
	MaxSize                          int32                        `json:"MaxSize"`
	DesiredCapacity                  int32                        `json:"DesiredCapacity"`
	DefaultCooldown                  int32                        `json:"DefaultCooldown"`
	HealthCheckGracePeriod           int32                        `json:"HealthCheckGracePeriod"`
	MaxInstanceLifetime              int32                        `json:"MaxInstanceLifetime,omitempty"`
	DefaultInstanceWarmup            int32                        `json:"DefaultInstanceWarmup,omitempty"`
	NewInstancesProtectedFromScaleIn bool                         `json:"NewInstancesProtectedFromScaleIn,omitempty"`
	CapacityRebalance                bool                         `json:"CapacityRebalance,omitempty"`
}

AutoScalingGroup represents an EC2 Auto Scaling group.

type BlockDeviceMapping

type BlockDeviceMapping struct {
	Ebs         *EbsBlockDevice `json:"Ebs,omitempty"`
	VirtualName string          `json:"VirtualName,omitempty"`
	DeviceName  string          `json:"DeviceName"`
	NoDevice    string          `json:"NoDevice,omitempty"`
}

BlockDeviceMapping represents an EBS or ephemeral block device mapping.

type CompleteLifecycleActionInput

type CompleteLifecycleActionInput struct {
	AutoScalingGroupName  string
	LifecycleHookName     string
	LifecycleActionToken  string
	InstanceID            string
	LifecycleActionResult string
}

CompleteLifecycleActionInput holds the input for CompleteLifecycleAction.

type CreateAutoScalingGroupInput

type CreateAutoScalingGroupInput struct {
	MixedInstancesPolicy             *MixedInstancesPolicy
	LaunchTemplate                   *LaunchTemplateSpecification
	AutoScalingGroupName             string
	LaunchConfigurationName          string
	HealthCheckType                  string
	VPCZoneIdentifier                string
	PlacementGroup                   string
	Context                          string
	DesiredCapacityType              string
	LoadBalancerNames                []string
	TargetGroupARNs                  []string
	TerminationPolicies              []string
	Tags                             []Tag
	AvailabilityZones                []string
	TrafficSources                   []TrafficSource
	LifecycleHookSpecificationList   []LifecycleHook
	MinSize                          int32
	DefaultCooldown                  int32
	HealthCheckGracePeriod           int32
	MaxInstanceLifetime              int32
	DefaultInstanceWarmup            int32
	MaxSize                          int32
	DesiredCapacity                  int32
	NewInstancesProtectedFromScaleIn bool
	CapacityRebalance                bool
}

CreateAutoScalingGroupInput holds the input for CreateAutoScalingGroup.

type CreateLaunchConfigurationInput

type CreateLaunchConfigurationInput struct {
	LaunchConfigurationName      string
	ImageID                      string
	InstanceType                 string
	KeyName                      string
	IAMInstanceProfile           string
	UserData                     string
	KernelID                     string
	RamdiskID                    string
	SpotPrice                    string
	PlacementTenancy             string
	ClassicLinkVPCID             string
	SecurityGroups               []string
	ClassicLinkVPCSecurityGroups []string
	BlockDeviceMappings          []BlockDeviceMapping
	AssociatePublicIPAddress     bool
	EbsOptimized                 bool
	InstanceMonitoring           bool
}

CreateLaunchConfigurationInput holds the input for CreateLaunchConfiguration.

type EC2Launcher

type EC2Launcher interface {
	// LaunchInstances launches count instances per spec and returns the real
	// EC2 instance IDs created. A partial success (fewer IDs than count) is
	// treated as the actual outcome, not an error.
	LaunchInstances(ctx context.Context, spec InstanceLaunchSpec, count int) ([]string, error)
	// TerminateInstances terminates the given real EC2 instance IDs.
	TerminateInstances(ctx context.Context, ids []string) error
}

EC2Launcher lets the Auto Scaling backend create and destroy real (mock) EC2 instances backing an Auto Scaling group's members, so instances an ASG scales out are visible to EC2 DescribeInstances and instances it scales in are actually terminated there too. When no EC2Launcher is configured (the default), the backend falls back to its historical behavior of fabricating instance IDs with no EC2-side record — see SetEC2Launcher.

Only groups using a LaunchConfiguration resolve to a launch spec today (ImageId/InstanceType/KeyName/SecurityGroups all live on LaunchConfiguration and are directly readable here). Groups using LaunchTemplate or MixedInstancesPolicy still fabricate instances even with a launcher configured, because the EC2 backend does not currently expose a way to resolve a launch template ID/name+version to its ImageId/InstanceType from outside the ec2 package.

type ELBTarget

type ELBTarget struct {
	ID   string
	Port int
}

ELBTarget identifies a single ELBv2 target to register or deregister. ID is the EC2 instance ID. Port is left zero so the target group's own configured port applies, matching how ELBv2 RegisterTargets/DeregisterTargets default an omitted target port from the target group itself.

type ELBv2TargetRegistrar

type ELBv2TargetRegistrar interface {
	// RegisterTargets registers targets with the given target group.
	RegisterTargets(ctx context.Context, targetGroupARN string, targets []ELBTarget) error
	// DeregisterTargets deregisters targets from the given target group.
	DeregisterTargets(ctx context.Context, targetGroupARN string, targets []ELBTarget) error
}

ELBv2TargetRegistrar lets the Auto Scaling backend register/deregister real ELBv2 targets as group membership and TargetGroupARNs change, so ELBv2 DescribeTargetHealth reflects ASG-managed instances instead of TargetGroupARNs/LoadBalancerNames being stored and echoed with no effect. When no registrar is configured (the default), behavior is unchanged from before this feature existed.

type EbsBlockDevice

type EbsBlockDevice struct {
	SnapshotID          string `json:"SnapshotId,omitempty"`
	VolumeType          string `json:"VolumeType,omitempty"`
	KmsKeyID            string `json:"KmsKeyId,omitempty"`
	VolumeSize          int32  `json:"VolumeSize,omitempty"`
	Iops                int32  `json:"Iops,omitempty"`
	Throughput          int32  `json:"Throughput,omitempty"`
	DeleteOnTermination bool   `json:"DeleteOnTermination,omitempty"`
	Encrypted           bool   `json:"Encrypted,omitempty"`
}

EbsBlockDevice describes an EBS volume configuration in a block device mapping.

type ExecutePolicyInput

type ExecutePolicyInput struct {
	MetricValue          *float64
	BreachThreshold      *float64
	AutoScalingGroupName string
	PolicyName           string
	HonorCooldown        bool
}

ExecutePolicyInput holds the input for ExecutePolicy. MetricValue and BreachThreshold are required (and only meaningful) when the target policy's PolicyType is StepScaling: AWS uses (MetricValue-BreachThreshold) to select which StepAdjustment interval applies.

type FailedScheduledAction

type FailedScheduledAction struct {
	ScheduledActionName string `json:"ScheduledActionName"`
	ErrorCode           string `json:"ErrorCode"`
	ErrorMessage        string `json:"ErrorMessage"`
}

FailedScheduledAction represents a scheduled action that failed during a batch operation.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for Autoscaling operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Autoscaling handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the Autoscaling action from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the Auto Scaling group name from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported Autoscaling operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for Autoscaling operations.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Purge

func (h *Handler) Purge(ctx context.Context, cutoff time.Time)

Purge implements service.Purgeable by removing all Auto Scaling resources older than cutoff.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches Autoscaling requests. Autoscaling requests are form-encoded POSTs with Version=2011-01-01.

func (*Handler) Shutdown

func (h *Handler) Shutdown(_ context.Context)

Shutdown stops the backend's in-flight lifecycle-hook timers so no timer goroutine outlives the service. Invoked on server shutdown via service.Shutdowner.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

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

InMemoryBackend implements StorageBackend using in-memory maps.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend.

func (*InMemoryBackend) AddInstanceRefresh

func (b *InMemoryBackend) AddInstanceRefresh(refresh InstanceRefresh) error

AddInstanceRefresh stores an instance refresh for the given group (used for testing CancelInstanceRefresh).

func (*InMemoryBackend) AddLifecycleHook

func (b *InMemoryBackend) AddLifecycleHook(hook LifecycleHook) error

AddLifecycleHook stores a lifecycle hook for the given group. This is the backend helper used by PutLifecycleHook and by tests.

func (*InMemoryBackend) AttachInstances

func (b *InMemoryBackend) AttachInstances(groupName string, instanceIDs []string) error

AttachInstances adds the given instance IDs to the specified Auto Scaling group.

func (*InMemoryBackend) AttachLoadBalancerTargetGroups

func (b *InMemoryBackend) AttachLoadBalancerTargetGroups(groupName string, targetGroupARNs []string) error

AttachLoadBalancerTargetGroups adds target group ARNs to the specified Auto Scaling group.

func (*InMemoryBackend) AttachLoadBalancers

func (b *InMemoryBackend) AttachLoadBalancers(groupName string, loadBalancerNames []string) error

AttachLoadBalancers adds load balancer names to the specified Auto Scaling group.

func (*InMemoryBackend) AttachTrafficSources

func (b *InMemoryBackend) AttachTrafficSources(groupName string, trafficSources []TrafficSource) error

AttachTrafficSources adds traffic sources to the specified Auto Scaling group.

func (*InMemoryBackend) BatchDeleteScheduledAction

func (b *InMemoryBackend) BatchDeleteScheduledAction(
	groupName string,
	scheduledActionNames []string,
) ([]FailedScheduledAction, error)

BatchDeleteScheduledAction removes the named scheduled actions from the group. Actions that cannot be found are returned as failures.

func (*InMemoryBackend) BatchPutScheduledUpdateGroupAction

func (b *InMemoryBackend) BatchPutScheduledUpdateGroupAction(
	groupName string,
	actions []ScheduledUpdateGroupAction,
) ([]FailedScheduledAction, error)

BatchPutScheduledUpdateGroupAction creates or updates scheduled actions for the group.

func (*InMemoryBackend) CancelInstanceRefresh

func (b *InMemoryBackend) CancelInstanceRefresh(groupName string) (string, error)

CancelInstanceRefresh cancels an active instance refresh for the group. It returns the ID of the cancelled refresh.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close stops any in-flight lifecycle-hook expiry timers so their goroutines do not outlive the backend. It is safe to call multiple times.

func (*InMemoryBackend) CompleteLifecycleAction

func (b *InMemoryBackend) CompleteLifecycleAction(input CompleteLifecycleActionInput) error

CompleteLifecycleAction completes a lifecycle action for the given group and hook.

func (*InMemoryBackend) CreateAutoScalingGroup

func (b *InMemoryBackend) CreateAutoScalingGroup(input CreateAutoScalingGroupInput) (*AutoScalingGroup, error)

CreateAutoScalingGroup creates a new Auto Scaling group.

func (*InMemoryBackend) CreateLaunchConfiguration

func (b *InMemoryBackend) CreateLaunchConfiguration(
	input CreateLaunchConfigurationInput,
) (*LaunchConfiguration, error)

CreateLaunchConfiguration creates a new launch configuration.

func (*InMemoryBackend) CreateOrUpdateTags

func (b *InMemoryBackend) CreateOrUpdateTags(tags []ResourceTag) error

CreateOrUpdateTags creates or updates tags on Auto Scaling resources. Only group (auto-scaling-group) resource tags are currently supported.

func (*InMemoryBackend) DeleteAutoScalingGroup

func (b *InMemoryBackend) DeleteAutoScalingGroup(name string, forceDelete bool) error

DeleteAutoScalingGroup removes an Auto Scaling group by name. When forceDelete is false, AWS rejects the delete if the group has active instances.

func (*InMemoryBackend) DeleteLaunchConfiguration

func (b *InMemoryBackend) DeleteLaunchConfiguration(name string) error

DeleteLaunchConfiguration removes a launch configuration by name.

func (*InMemoryBackend) DeleteLifecycleHook

func (b *InMemoryBackend) DeleteLifecycleHook(groupName, hookName string) error

DeleteLifecycleHook removes a lifecycle hook from the specified Auto Scaling group.

func (*InMemoryBackend) DeleteNotificationConfiguration

func (b *InMemoryBackend) DeleteNotificationConfiguration(groupName, topicARN string) error

DeleteNotificationConfiguration removes notification configs for a group+topic.

func (*InMemoryBackend) DeletePolicy

func (b *InMemoryBackend) DeletePolicy(groupName, policyNameOrARN string) error

DeletePolicy removes a scaling policy from the ASG.

func (*InMemoryBackend) DeleteScheduledAction

func (b *InMemoryBackend) DeleteScheduledAction(groupName, scheduledActionName string) error

DeleteScheduledAction removes a single scheduled action from the ASG.

func (*InMemoryBackend) DeleteTags

func (b *InMemoryBackend) DeleteTags(tags []ResourceTag) error

DeleteTags removes tags from Auto Scaling resources. Only auto-scaling-group resource tags are supported.

func (*InMemoryBackend) DeleteWarmPool

func (b *InMemoryBackend) DeleteWarmPool(groupName string) error

DeleteWarmPool removes the warm pool for the ASG.

func (*InMemoryBackend) DescribeAccountLimits

func (b *InMemoryBackend) DescribeAccountLimits() (*AccountLimits, error)

DescribeAccountLimits returns account limits for Auto Scaling.

func (*InMemoryBackend) DescribeAdjustmentTypes

func (b *InMemoryBackend) DescribeAdjustmentTypes() ([]string, error)

DescribeAdjustmentTypes returns the supported scaling adjustment types.

func (*InMemoryBackend) DescribeAutoScalingGroups

func (b *InMemoryBackend) DescribeAutoScalingGroups(names []string) ([]AutoScalingGroup, error)

DescribeAutoScalingGroups returns Auto Scaling groups, optionally filtered by name.

func (*InMemoryBackend) DescribeAutoScalingInstances

func (b *InMemoryBackend) DescribeAutoScalingInstances(instanceIDs []string) ([]InstanceDetails, error)

DescribeAutoScalingInstances returns instance details across all ASGs, optionally filtered by instance ID.

func (*InMemoryBackend) DescribeAutoScalingNotificationTypes

func (b *InMemoryBackend) DescribeAutoScalingNotificationTypes() ([]string, error)

DescribeAutoScalingNotificationTypes returns the supported notification types.

func (*InMemoryBackend) DescribeInstanceRefreshes

func (b *InMemoryBackend) DescribeInstanceRefreshes(groupName string, refreshIDs []string) ([]InstanceRefresh, error)

DescribeInstanceRefreshes returns instance refreshes for the group, optionally filtered by ID.

func (*InMemoryBackend) DescribeLaunchConfigurations

func (b *InMemoryBackend) DescribeLaunchConfigurations(names []string) ([]LaunchConfiguration, error)

DescribeLaunchConfigurations returns launch configurations, optionally filtered by name.

func (*InMemoryBackend) DescribeLifecycleHookTypes

func (b *InMemoryBackend) DescribeLifecycleHookTypes() ([]string, error)

DescribeLifecycleHookTypes returns the supported lifecycle hook transition types.

func (*InMemoryBackend) DescribeLifecycleHooks

func (b *InMemoryBackend) DescribeLifecycleHooks(groupName string, hookNames []string) ([]LifecycleHook, error)

DescribeLifecycleHooks returns lifecycle hooks for the given group, optionally filtered by name.

func (*InMemoryBackend) DescribeLoadBalancerTargetGroups

func (b *InMemoryBackend) DescribeLoadBalancerTargetGroups(groupName string) ([]LoadBalancerTargetGroupState, error)

DescribeLoadBalancerTargetGroups returns the target groups attached to the group.

func (*InMemoryBackend) DescribeLoadBalancers

func (b *InMemoryBackend) DescribeLoadBalancers(groupName string) ([]LoadBalancerState, error)

DescribeLoadBalancers returns the load balancers attached to the group.

func (*InMemoryBackend) DescribeMetricCollectionTypes

func (b *InMemoryBackend) DescribeMetricCollectionTypes() ([]MetricCollectionType, error)

DescribeMetricCollectionTypes returns the supported metric collection types.

func (*InMemoryBackend) DescribeNotificationConfigurations

func (b *InMemoryBackend) DescribeNotificationConfigurations(groupNames []string) ([]NotificationConfiguration, error)

DescribeNotificationConfigurations returns notification configs for the given groups.

func (*InMemoryBackend) DescribePolicies

func (b *InMemoryBackend) DescribePolicies(groupName string, policyNames []string) ([]ScalingPolicy, error)

DescribePolicies returns scaling policies for the given group, optionally filtered by name.

func (*InMemoryBackend) DescribeScalingActivities

func (b *InMemoryBackend) DescribeScalingActivities(groupName string) ([]ScalingActivity, error)

DescribeScalingActivities returns scaling activities for the given group.

func (*InMemoryBackend) DescribeScalingProcessTypes

func (b *InMemoryBackend) DescribeScalingProcessTypes() ([]string, error)

DescribeScalingProcessTypes returns the supported scaling process types.

func (*InMemoryBackend) DescribeScheduledActions

func (b *InMemoryBackend) DescribeScheduledActions(
	groupName string,
	actionNames []string,
) ([]ScheduledAction, error)

DescribeScheduledActions returns scheduled actions for the given group, optionally filtered by name.

func (*InMemoryBackend) DescribeTags

func (b *InMemoryBackend) DescribeTags(filters []TagFilter) ([]ResourceTag, error)

DescribeTags returns tags for Auto Scaling resources, with optional filtering.

func (*InMemoryBackend) DescribeTerminationPolicyTypes

func (b *InMemoryBackend) DescribeTerminationPolicyTypes() ([]string, error)

DescribeTerminationPolicyTypes returns the supported termination policy types.

func (*InMemoryBackend) DescribeTrafficSources

func (b *InMemoryBackend) DescribeTrafficSources(groupName string) ([]TrafficSourceState, error)

DescribeTrafficSources returns the traffic sources attached to the group.

func (*InMemoryBackend) DescribeWarmPool

func (b *InMemoryBackend) DescribeWarmPool(groupName string) (*WarmPool, error)

DescribeWarmPool returns the warm pool configuration for the ASG.

func (*InMemoryBackend) DetachInstances

func (b *InMemoryBackend) DetachInstances(
	groupName string, instanceIDs []string, shouldDecrement bool,
) ([]ScalingActivity, error)

DetachInstances removes instances from the ASG, optionally decrementing desired capacity.

func (*InMemoryBackend) DetachLoadBalancerTargetGroups

func (b *InMemoryBackend) DetachLoadBalancerTargetGroups(groupName string, targetGroupARNs []string) error

DetachLoadBalancerTargetGroups removes target group ARNs from the ASG.

func (*InMemoryBackend) DetachLoadBalancers

func (b *InMemoryBackend) DetachLoadBalancers(groupName string, lbNames []string) error

DetachLoadBalancers removes load balancer names from the ASG.

func (*InMemoryBackend) DetachTrafficSources

func (b *InMemoryBackend) DetachTrafficSources(groupName string, trafficSources []TrafficSource) error

DetachTrafficSources removes traffic sources from the ASG.

func (*InMemoryBackend) DisableMetricsCollection

func (b *InMemoryBackend) DisableMetricsCollection(groupName string, metrics []string) error

DisableMetricsCollection removes metrics from the ASG's enabled metrics list.

func (*InMemoryBackend) EnableMetricsCollection

func (b *InMemoryBackend) EnableMetricsCollection(groupName string, metrics []string, _ string) error

EnableMetricsCollection adds metrics to the ASG's enabled metrics list.

func (*InMemoryBackend) EnterStandby

func (b *InMemoryBackend) EnterStandby(
	groupName string,
	instanceIDs []string,
	decrementCapacity bool,
) ([]ScalingActivity, error)

EnterStandby puts instances into standby mode.

func (*InMemoryBackend) ExecutePolicy

func (b *InMemoryBackend) ExecutePolicy(input ExecutePolicyInput) error

ExecutePolicy executes a scaling policy on the ASG.

func (*InMemoryBackend) ExitStandby

func (b *InMemoryBackend) ExitStandby(groupName string, instanceIDs []string) ([]ScalingActivity, error)

ExitStandby moves instances from standby back to InService.

func (*InMemoryBackend) GetPredictiveScalingForecast

func (b *InMemoryBackend) GetPredictiveScalingForecast(groupName string) error

GetPredictiveScalingForecast validates the group exists (stub implementation).

func (*InMemoryBackend) LaunchInstances

func (b *InMemoryBackend) LaunchInstances(groupName string, count int32) ([]Instance, error)

LaunchInstances adds new instances to the ASG.

func (*InMemoryBackend) Purge

func (b *InMemoryBackend) Purge(ctx context.Context, cutoff time.Time)

Purge removes all AutoScaling groups and launch configurations created before the cutoff time.

func (*InMemoryBackend) PutLifecycleHook

func (b *InMemoryBackend) PutLifecycleHook(hook LifecycleHook) error

PutLifecycleHook creates or updates a lifecycle hook on an Auto Scaling group.

func (*InMemoryBackend) PutNotificationConfiguration

func (b *InMemoryBackend) PutNotificationConfiguration(groupName, topicARN string, types []string) error

PutNotificationConfiguration stores or updates a notification configuration.

func (*InMemoryBackend) PutScalingPolicy

func (b *InMemoryBackend) PutScalingPolicy(input ScalingPolicyInput) (*ScalingPolicy, error)

PutScalingPolicy creates or updates a scaling policy.

func (*InMemoryBackend) PutScheduledUpdateGroupAction

func (b *InMemoryBackend) PutScheduledUpdateGroupAction(groupName string, action ScheduledUpdateGroupAction) error

PutScheduledUpdateGroupAction creates or updates a single scheduled action.

func (*InMemoryBackend) PutWarmPool

func (b *InMemoryBackend) PutWarmPool(input WarmPoolInput) error

PutWarmPool creates or updates a warm pool configuration for the ASG.

func (*InMemoryBackend) RecordLifecycleActionHeartbeat

func (b *InMemoryBackend) RecordLifecycleActionHeartbeat(input RecordLifecycleActionHeartbeatInput) error

RecordLifecycleActionHeartbeat resets or validates a lifecycle action heartbeat.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore populates the backend from a JSON payload.

func (*InMemoryBackend) ResumeProcesses

func (b *InMemoryBackend) ResumeProcesses(groupName string, processes []string) error

ResumeProcesses removes processes from the ASG's suspended processes list.

func (*InMemoryBackend) RollbackInstanceRefresh

func (b *InMemoryBackend) RollbackInstanceRefresh(groupName string) (string, error)

RollbackInstanceRefresh rolls back an in-progress instance refresh for the group.

func (*InMemoryBackend) SetDesiredCapacity

func (b *InMemoryBackend) SetDesiredCapacity(groupName string, desiredCapacity int32) error

SetDesiredCapacity adjusts the DesiredCapacity of an Auto Scaling group immediately.

func (*InMemoryBackend) SetEC2Launcher

func (b *InMemoryBackend) SetEC2Launcher(l EC2Launcher)

SetEC2Launcher wires an EC2Launcher so subsequent scale-out/scale-in operations launch and terminate real (mock) EC2 instances instead of fabricating instance IDs. Passing nil restores the historical, fabrication-only behavior. Intended to be called once during service wiring, before the backend serves traffic.

func (*InMemoryBackend) SetELBv2Registrar

func (b *InMemoryBackend) SetELBv2Registrar(r ELBv2TargetRegistrar)

SetELBv2Registrar wires an ELBv2TargetRegistrar so subsequent instance launches/terminations and TargetGroupARNs attach/detach calls register or deregister real ELBv2 targets. Passing nil restores the historical, registration-less behavior. Intended to be called once during service wiring, before the backend serves traffic.

func (*InMemoryBackend) SetInstanceHealth

func (b *InMemoryBackend) SetInstanceHealth(
	instanceID string,
	healthStatus string,
	shouldRespectGracePeriod bool,
) error

SetInstanceHealth sets the health status of an instance across all ASGs. When shouldRespectGracePeriod is true and the instance launched within the group's HealthCheckGracePeriod, the unhealthy mark is silently ignored (AWS behavior).

func (*InMemoryBackend) SetInstanceProtection

func (b *InMemoryBackend) SetInstanceProtection(
	groupName string,
	instanceIDs []string,
	protectedFromScaleIn bool,
) error

SetInstanceProtection sets the protected-from-scale-in flag on instances.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) StartInstanceRefresh

func (b *InMemoryBackend) StartInstanceRefresh(groupName string) (*InstanceRefresh, error)

StartInstanceRefresh creates a new instance refresh for the group.

func (*InMemoryBackend) StartInstanceRefreshWithInput

func (b *InMemoryBackend) StartInstanceRefreshWithInput(input StartInstanceRefreshInput) (*InstanceRefresh, error)

StartInstanceRefreshWithInput creates a new instance refresh for the group with full input.

func (*InMemoryBackend) SuspendProcesses

func (b *InMemoryBackend) SuspendProcesses(groupName string, processes []string) error

SuspendProcesses adds processes to the ASG's suspended processes list.

func (*InMemoryBackend) TerminateInstanceInAutoScalingGroup

func (b *InMemoryBackend) TerminateInstanceInAutoScalingGroup(
	instanceID string,
	shouldDecrement bool,
) (*ScalingActivity, error)

TerminateInstanceInAutoScalingGroup terminates a specific instance in an ASG. When shouldDecrement is true, MinSize is decremented (capped at 0) and DesiredCapacity is decreased by 1 without a replacement. Otherwise a replacement is launched.

func (*InMemoryBackend) UpdateAutoScalingGroup

func (b *InMemoryBackend) UpdateAutoScalingGroup(input UpdateAutoScalingGroupInput) (*AutoScalingGroup, error)

UpdateAutoScalingGroup updates an existing Auto Scaling group.

type Instance

type Instance struct {
	LaunchTime              time.Time `json:"LaunchTime,omitzero"`
	InstanceID              string    `json:"InstanceID"`
	AvailabilityZone        string    `json:"AvailabilityZone"`
	LifecycleState          string    `json:"LifecycleState"`
	HealthStatus            string    `json:"HealthStatus"`
	LaunchConfigurationName string    `json:"LaunchConfigurationName,omitempty"`
	InstanceType            string    `json:"InstanceType,omitempty"`
	ProtectedFromScaleIn    bool      `json:"ProtectedFromScaleIn,omitempty"`
}

Instance represents an EC2 instance in an Auto Scaling group.

type InstanceDetails

type InstanceDetails struct {
	AutoScalingGroupName    string `json:"AutoScalingGroupName"`
	InstanceID              string `json:"InstanceId"`
	AvailabilityZone        string `json:"AvailabilityZone"`
	LifecycleState          string `json:"LifecycleState"`
	HealthStatus            string `json:"HealthStatus"`
	LaunchConfigurationName string `json:"LaunchConfigurationName,omitempty"`
	InstanceType            string `json:"InstanceType,omitempty"`
	ProtectedFromScaleIn    bool   `json:"ProtectedFromScaleIn"`
}

InstanceDetails holds detailed information about an EC2 instance in an ASG.

type InstanceLaunchSpec

type InstanceLaunchSpec struct {
	Tags             map[string]string
	ImageID          string
	InstanceType     string
	SubnetID         string
	AvailabilityZone string
	KeyName          string
	SecurityGroups   []string
}

InstanceLaunchSpec carries the EC2 launch parameters an Auto Scaling group derives from its LaunchConfiguration (LaunchTemplate/MixedInstancesPolicy support is a follow-up — see EC2Launcher doc comment) for a single scale-out batch, passed to an EC2Launcher so it can create real backing EC2 instances.

type InstanceRefresh

type InstanceRefresh struct {
	StartTime            time.Time `json:"StartTime"`
	EndTime              time.Time `json:"EndTime,omitzero"`
	InstanceRefreshID    string    `json:"InstanceRefreshId"`
	AutoScalingGroupName string    `json:"AutoScalingGroupName"`
	Status               string    `json:"Status"`
	StatusReason         string    `json:"StatusReason,omitempty"`
	// Strategy is the instance refresh strategy; defaults to "Rolling".
	Strategy           string                     `json:"Strategy,omitempty"`
	Preferences        InstanceRefreshPreferences `json:"Preferences"`
	PercentageComplete int32                      `json:"PercentageComplete,omitempty"`
	InstancesToUpdate  int32                      `json:"InstancesToUpdate,omitempty"`
}

InstanceRefresh represents an instance refresh operation for an Auto Scaling group.

type InstanceRefreshPreferences

type InstanceRefreshPreferences struct {
	ScaleInProtectedInstances string  `json:"ScaleInProtectedInstances,omitempty"`
	StandbyInstances          string  `json:"StandbyInstances,omitempty"`
	CheckpointPercentages     []int32 `json:"CheckpointPercentages,omitempty"`
	MinHealthyPercentage      int32   `json:"MinHealthyPercentage,omitempty"`
	MaxHealthyPercentage      int32   `json:"MaxHealthyPercentage,omitempty"`
	InstanceWarmup            int32   `json:"InstanceWarmup,omitempty"`
	CheckpointDelay           int32   `json:"CheckpointDelay,omitempty"`
	SkipMatching              bool    `json:"SkipMatching,omitempty"`
	AutoRollback              bool    `json:"AutoRollback,omitempty"`
}

InstanceRefreshPreferences holds the preferences for an instance refresh operation.

type InstanceReusePolicy

type InstanceReusePolicy struct {
	ReuseOnScaleIn bool `json:"ReuseOnScaleIn,omitempty"`
}

InstanceReusePolicy controls whether warm-pool instances are reused on scale-in.

type InstancesDistribution

type InstancesDistribution struct {
	OnDemandAllocationStrategy          string `json:"OnDemandAllocationStrategy,omitempty"`
	SpotAllocationStrategy              string `json:"SpotAllocationStrategy,omitempty"`
	SpotMaxPrice                        string `json:"SpotMaxPrice,omitempty"`
	OnDemandBaseCapacity                int32  `json:"OnDemandBaseCapacity,omitempty"`
	OnDemandPercentageAboveBaseCapacity int32  `json:"OnDemandPercentageAboveBaseCapacity,omitempty"`
	SpotInstancePools                   int32  `json:"SpotInstancePools,omitempty"`
}

InstancesDistribution controls on-demand vs spot allocation in MixedInstancesPolicy.

type LaunchConfiguration

type LaunchConfiguration struct {
	CreatedTime                  time.Time            `json:"CreatedTime"`
	LaunchConfigurationName      string               `json:"LaunchConfigurationName"`
	LaunchConfigurationARN       string               `json:"LaunchConfigurationARN"`
	ImageID                      string               `json:"ImageID"`
	InstanceType                 string               `json:"InstanceType"`
	KeyName                      string               `json:"KeyName,omitempty"`
	IAMInstanceProfile           string               `json:"IAMInstanceProfile,omitempty"`
	UserData                     string               `json:"UserData,omitempty"`
	KernelID                     string               `json:"KernelID,omitempty"`
	RamdiskID                    string               `json:"RamdiskID,omitempty"`
	SpotPrice                    string               `json:"SpotPrice,omitempty"`
	PlacementTenancy             string               `json:"PlacementTenancy,omitempty"`
	ClassicLinkVPCID             string               `json:"ClassicLinkVpcId,omitempty"`
	BlockDeviceMappings          []BlockDeviceMapping `json:"BlockDeviceMappings,omitempty"`
	ClassicLinkVPCSecurityGroups []string             `json:"ClassicLinkVpcSecurityGroups,omitempty"`
	SecurityGroups               []string             `json:"SecurityGroups,omitempty"`
	AssociatePublicIPAddress     bool                 `json:"AssociatePublicIpAddress,omitempty"`
	EbsOptimized                 bool                 `json:"EbsOptimized,omitempty"`
	InstanceMonitoring           bool                 `json:"InstanceMonitoring,omitempty"`
}

LaunchConfiguration represents an Auto Scaling launch configuration.

type LaunchTemplateOverride

type LaunchTemplateOverride struct {
	InstanceType                string                       `json:"InstanceType,omitempty"`
	LaunchTemplateSpecification *LaunchTemplateSpecification `json:"LaunchTemplateSpecification,omitempty"`
	WeightedCapacity            string                       `json:"WeightedCapacity,omitempty"`
}

LaunchTemplateOverride allows specifying per-instance-type overrides in a MixedInstancesPolicy.

type LaunchTemplateSpecification

type LaunchTemplateSpecification struct {
	LaunchTemplateID   string `json:"LaunchTemplateId,omitempty"`
	LaunchTemplateName string `json:"LaunchTemplateName,omitempty"`
	Version            string `json:"Version,omitempty"`
}

LaunchTemplateSpecification identifies an EC2 launch template.

type LifecycleHook

type LifecycleHook struct {
	LifecycleHookName     string `json:"LifecycleHookName"`
	AutoScalingGroupName  string `json:"AutoScalingGroupName"`
	LifecycleTransition   string `json:"LifecycleTransition,omitempty"`
	DefaultResult         string `json:"DefaultResult,omitempty"`
	NotificationTargetARN string `json:"NotificationTargetARN,omitempty"`
	NotificationMetadata  string `json:"NotificationMetadata,omitempty"`
	RoleARN               string `json:"RoleARN,omitempty"`
	HeartbeatTimeout      int32  `json:"HeartbeatTimeout,omitempty"`
	GlobalTimeout         int32  `json:"GlobalTimeout,omitempty"`
}

LifecycleHook represents a lifecycle hook attached to an Auto Scaling group.

type LoadBalancerState

type LoadBalancerState struct {
	LoadBalancerName string `json:"LoadBalancerName"`
	State            string `json:"State"`
}

LoadBalancerState represents the state of a load balancer attached to an ASG.

type LoadBalancerTargetGroupState

type LoadBalancerTargetGroupState struct {
	LoadBalancerTargetGroupARN string `json:"LoadBalancerTargetGroupARN"`
	State                      string `json:"State"`
}

LoadBalancerTargetGroupState represents the state of a target group attached to an ASG.

type MetricCollectionType

type MetricCollectionType struct {
	Metric      string `json:"Metric"`
	Granularity string `json:"Granularity,omitempty"`
}

MetricCollectionType represents a type of metric that can be collected.

type MixedInstancesLaunchTemplate

type MixedInstancesLaunchTemplate struct {
	LaunchTemplateSpecification LaunchTemplateSpecification `json:"LaunchTemplateSpecification"`
	Overrides                   []LaunchTemplateOverride    `json:"Overrides,omitempty"`
}

MixedInstancesLaunchTemplate is the launch template component of MixedInstancesPolicy.

type MixedInstancesPolicy

type MixedInstancesPolicy struct {
	LaunchTemplate        MixedInstancesLaunchTemplate `json:"LaunchTemplate"`
	InstancesDistribution InstancesDistribution        `json:"InstancesDistribution"`
}

MixedInstancesPolicy allows combining on-demand and spot instances with multiple instance types.

type NotificationConfiguration

type NotificationConfiguration struct {
	AutoScalingGroupName string `json:"AutoScalingGroupName"`
	TopicARN             string `json:"TopicARN"`
	NotificationType     string `json:"NotificationType"`
}

NotificationConfiguration represents a notification configuration for an Auto Scaling group.

type Provider

type Provider struct{}

Provider implements service.Provider for the Autoscaling service.

func (*Provider) Init

Init initializes the Autoscaling backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type RecordLifecycleActionHeartbeatInput

type RecordLifecycleActionHeartbeatInput struct {
	AutoScalingGroupName string
	LifecycleHookName    string
	LifecycleActionToken string
	InstanceID           string
}

RecordLifecycleActionHeartbeatInput holds the input for RecordLifecycleActionHeartbeat.

type ResourceTag

type ResourceTag struct {
	ResourceID        string `json:"ResourceId"`
	ResourceType      string `json:"ResourceType"`
	Key               string `json:"Key"`
	Value             string `json:"Value"`
	PropagateAtLaunch bool   `json:"PropagateAtLaunch,omitempty"`
}

ResourceTag is a tag scoped to a specific resource (used by CreateOrUpdateTags).

type ScalingActivity

type ScalingActivity struct {
	StartTime            time.Time `json:"StartTime"`
	EndTime              time.Time `json:"EndTime"`
	ActivityID           string    `json:"ActivityID"`
	AutoScalingGroupName string    `json:"AutoScalingGroupName"`
	Description          string    `json:"Description,omitempty"`
	StatusCode           string    `json:"StatusCode"`
	StatusMessage        string    `json:"StatusMessage,omitempty"`
	Progress             int32     `json:"Progress"`
}

ScalingActivity represents an Auto Scaling activity.

type ScalingPolicy

type ScalingPolicy struct {
	CustomizedMetricSpecification string           `json:"CustomizedMetricSpecification,omitempty"`
	PolicyName                    string           `json:"PolicyName"`
	AutoScalingGroupName          string           `json:"AutoScalingGroupName"`
	PolicyType                    string           `json:"PolicyType,omitempty"`
	AdjustmentType                string           `json:"AdjustmentType,omitempty"`
	MetricType                    string           `json:"MetricType,omitempty"`
	CustomMetricSpec              string           `json:"CustomMetricSpec,omitempty"`
	MetricAggregationType         string           `json:"MetricAggregationType,omitempty"`
	PolicyARN                     string           `json:"PolicyARN"`
	StepAdjustments               []StepAdjustment `json:"StepAdjustments,omitempty"`
	TargetValue                   float64          `json:"TargetValue,omitempty"`
	MinAdjustmentStep             int32            `json:"MinAdjustmentStep,omitempty"`
	MinAdjustmentMagnitude        int32            `json:"MinAdjustmentMagnitude,omitempty"`
	Cooldown                      int32            `json:"Cooldown,omitempty"`
	EstimatedWarmup               int32            `json:"EstimatedWarmup,omitempty"`
	ScalingAdjustment             int32            `json:"ScalingAdjustment,omitempty"`
	DisableScaleIn                bool             `json:"DisableScaleIn,omitempty"`
}

ScalingPolicy represents a scaling policy for an Auto Scaling group.

type ScalingPolicyInput

type ScalingPolicyInput struct {
	CustomizedMetricSpecification string
	PolicyName                    string
	PolicyType                    string
	AdjustmentType                string
	MetricType                    string
	MetricAggregationType         string
	AutoScalingGroupName          string
	StepAdjustments               []StepAdjustment
	TargetValue                   float64
	MinAdjustmentStep             int32
	ScalingAdjustment             int32
	Cooldown                      int32
	EstimatedWarmup               int32
	MinAdjustmentMagnitude        int32
	DisableScaleIn                bool
}

ScalingPolicyInput holds the input for PutScalingPolicy.

type ScheduledAction

type ScheduledAction struct {
	StartTime            time.Time `json:"StartTime,omitzero"`
	EndTime              time.Time `json:"EndTime,omitzero"`
	DesiredCapacity      *int32    `json:"DesiredCapacity,omitempty"`
	MinSize              *int32    `json:"MinSize,omitempty"`
	MaxSize              *int32    `json:"MaxSize,omitempty"`
	ScheduledActionName  string    `json:"ScheduledActionName"`
	ScheduledActionARN   string    `json:"ScheduledActionARN,omitempty"`
	AutoScalingGroupName string    `json:"AutoScalingGroupName"`
	Recurrence           string    `json:"Recurrence,omitempty"`
	TimeZone             string    `json:"TimeZone,omitempty"`
}

ScheduledAction represents a scheduled scaling action for an Auto Scaling group.

type ScheduledUpdateGroupAction

type ScheduledUpdateGroupAction struct {
	StartTime           time.Time `json:"StartTime,omitzero"`
	EndTime             time.Time `json:"EndTime,omitzero"`
	DesiredCapacity     *int32    `json:"DesiredCapacity,omitempty"`
	MinSize             *int32    `json:"MinSize,omitempty"`
	MaxSize             *int32    `json:"MaxSize,omitempty"`
	ScheduledActionName string    `json:"ScheduledActionName"`
	Recurrence          string    `json:"Recurrence,omitempty"`
	TimeZone            string    `json:"TimeZone,omitempty"`
}

ScheduledUpdateGroupAction is the input for a single action in BatchPutScheduledUpdateGroupAction.

type StartInstanceRefreshInput

type StartInstanceRefreshInput struct {
	AutoScalingGroupName string
	Strategy             string
	Preferences          InstanceRefreshPreferences
}

StartInstanceRefreshInput holds the input for StartInstanceRefresh.

type StepAdjustment

type StepAdjustment struct {
	MetricIntervalLowerBound *float64 `json:"MetricIntervalLowerBound,omitempty"`
	MetricIntervalUpperBound *float64 `json:"MetricIntervalUpperBound,omitempty"`
	ScalingAdjustment        int32    `json:"ScalingAdjustment"`
}

StepAdjustment defines a scaling adjustment with a metric interval bound.

type StorageBackend

type StorageBackend interface {
	CreateAutoScalingGroup(input CreateAutoScalingGroupInput) (*AutoScalingGroup, error)
	DescribeAutoScalingGroups(names []string) ([]AutoScalingGroup, error)
	UpdateAutoScalingGroup(input UpdateAutoScalingGroupInput) (*AutoScalingGroup, error)
	DeleteAutoScalingGroup(name string, forceDelete bool) error

	CreateLaunchConfiguration(input CreateLaunchConfigurationInput) (*LaunchConfiguration, error)
	DescribeLaunchConfigurations(names []string) ([]LaunchConfiguration, error)
	DeleteLaunchConfiguration(name string) error

	DescribeScalingActivities(groupName string) ([]ScalingActivity, error)

	AttachInstances(groupName string, instanceIDs []string) error
	AttachLoadBalancerTargetGroups(groupName string, targetGroupARNs []string) error
	AttachLoadBalancers(groupName string, loadBalancerNames []string) error
	AttachTrafficSources(groupName string, trafficSources []TrafficSource) error

	BatchDeleteScheduledAction(
		groupName string,
		scheduledActionNames []string,
	) ([]FailedScheduledAction, error)
	BatchPutScheduledUpdateGroupAction(
		groupName string,
		actions []ScheduledUpdateGroupAction,
	) ([]FailedScheduledAction, error)

	CancelInstanceRefresh(groupName string) (string, error)
	CompleteLifecycleAction(input CompleteLifecycleActionInput) error
	CreateOrUpdateTags(tags []ResourceTag) error
	DeleteLifecycleHook(groupName, hookName string) error

	SetDesiredCapacity(groupName string, desiredCapacity int32) error
	TerminateInstanceInAutoScalingGroup(instanceID string, shouldDecrement bool) (*ScalingActivity, error)
	PutLifecycleHook(hook LifecycleHook) error
	DescribeLifecycleHooks(groupName string, hookNames []string) ([]LifecycleHook, error)
	DescribeScheduledActions(groupName string, actionNames []string) ([]ScheduledAction, error)
	DeleteTags(tags []ResourceTag) error
	DescribeTags(filters []TagFilter) ([]ResourceTag, error)
	DescribeAutoScalingInstances(instanceIDs []string) ([]InstanceDetails, error)

	// Static describe methods
	DescribeAccountLimits() (*AccountLimits, error)
	DescribeAdjustmentTypes() ([]string, error)
	DescribeAutoScalingNotificationTypes() ([]string, error)
	DescribeLifecycleHookTypes() ([]string, error)
	DescribeMetricCollectionTypes() ([]MetricCollectionType, error)
	DescribeScalingProcessTypes() ([]string, error)
	DescribeTerminationPolicyTypes() ([]string, error)

	// Instance refresh
	StartInstanceRefresh(groupName string) (*InstanceRefresh, error)
	StartInstanceRefreshWithInput(input StartInstanceRefreshInput) (*InstanceRefresh, error)
	RollbackInstanceRefresh(groupName string) (string, error)
	DescribeInstanceRefreshes(groupName string, refreshIDs []string) ([]InstanceRefresh, error)

	// LB/TG/Traffic describe
	DescribeLoadBalancers(groupName string) ([]LoadBalancerState, error)
	DescribeLoadBalancerTargetGroups(groupName string) ([]LoadBalancerTargetGroupState, error)
	DescribeTrafficSources(groupName string) ([]TrafficSourceState, error)

	// Detach operations
	DetachInstances(groupName string, instanceIDs []string, shouldDecrement bool) ([]ScalingActivity, error)
	DetachLoadBalancerTargetGroups(groupName string, targetGroupARNs []string) error
	DetachLoadBalancers(groupName string, lbNames []string) error
	DetachTrafficSources(groupName string, trafficSources []TrafficSource) error

	// Metrics
	EnableMetricsCollection(groupName string, metrics []string, granularity string) error
	DisableMetricsCollection(groupName string, metrics []string) error

	// Process ops
	SuspendProcesses(groupName string, processes []string) error
	ResumeProcesses(groupName string, processes []string) error

	// Standby
	EnterStandby(groupName string, instanceIDs []string, decrementCapacity bool) ([]ScalingActivity, error)
	ExitStandby(groupName string, instanceIDs []string) ([]ScalingActivity, error)

	// Instance state
	SetInstanceHealth(instanceID string, healthStatus string, shouldRespectGracePeriod bool) error
	SetInstanceProtection(groupName string, instanceIDs []string, protectedFromScaleIn bool) error

	// Lifecycle heartbeat
	RecordLifecycleActionHeartbeat(input RecordLifecycleActionHeartbeatInput) error

	// Execute policy
	ExecutePolicy(input ExecutePolicyInput) error

	// Launch instances
	LaunchInstances(groupName string, count int32) ([]Instance, error)

	// Predictive scaling
	GetPredictiveScalingForecast(groupName string) error

	// Notification configs
	PutNotificationConfiguration(groupName, topicARN string, types []string) error
	DeleteNotificationConfiguration(groupName, topicARN string) error
	DescribeNotificationConfigurations(groupNames []string) ([]NotificationConfiguration, error)

	// Scaling policies
	PutScalingPolicy(input ScalingPolicyInput) (*ScalingPolicy, error)
	DeletePolicy(groupName, policyNameOrARN string) error
	DescribePolicies(groupName string, policyNames []string) ([]ScalingPolicy, error)

	// Scheduled actions (single)
	PutScheduledUpdateGroupAction(groupName string, action ScheduledUpdateGroupAction) error
	DeleteScheduledAction(groupName, scheduledActionName string) error

	// Warm pool
	PutWarmPool(input WarmPoolInput) error
	DeleteWarmPool(groupName string) error
	DescribeWarmPool(groupName string) (*WarmPool, error)
}

StorageBackend is the interface for the Autoscaling in-memory store.

type Tag

type Tag struct {
	Key               string `json:"Key"`
	Value             string `json:"Value"`
	PropagateAtLaunch bool   `json:"PropagateAtLaunch,omitempty"`
}

Tag is a key/value pair attached to a resource, optionally propagated to new instances.

type TagFilter

type TagFilter struct {
	Name   string
	Values []string
}

TagFilter filters tags by resource type, resource ID, or key/value pairs.

type TrafficSource

type TrafficSource struct {
	Identifier string `json:"Identifier"`
	Type       string `json:"Type"`
}

TrafficSource identifies a traffic source attached to an Auto Scaling group.

type TrafficSourceState

type TrafficSourceState struct {
	Identifier string `json:"Identifier"`
	Type       string `json:"Type"`
	State      string `json:"State"`
}

TrafficSourceState represents the state of a traffic source attached to an ASG.

type UpdateAutoScalingGroupInput

type UpdateAutoScalingGroupInput struct {
	LaunchTemplate                   *LaunchTemplateSpecification
	MaxSize                          *int32
	DesiredCapacity                  *int32
	DefaultCooldown                  *int32
	HealthCheckGracePeriod           *int32
	MaxInstanceLifetime              *int32
	DefaultInstanceWarmup            *int32
	NewInstancesProtectedFromScaleIn *bool
	CapacityRebalance                *bool
	MixedInstancesPolicy             *MixedInstancesPolicy
	MinSize                          *int32
	LaunchConfigurationName          string
	VPCZoneIdentifier                string
	PlacementGroup                   string
	Context                          string
	DesiredCapacityType              string
	HealthCheckType                  string
	AutoScalingGroupName             string
	AvailabilityZones                []string
	TerminationPolicies              []string
}

UpdateAutoScalingGroupInput holds the input for UpdateAutoScalingGroup.

type WarmPool

type WarmPool struct {
	AutoScalingGroupName     string              `json:"AutoScalingGroupName"`
	PoolState                string              `json:"PoolState,omitempty"`
	Status                   string              `json:"Status,omitempty"`
	MinSize                  int32               `json:"MinSize,omitempty"`
	MaxGroupPreparedCapacity int32               `json:"MaxGroupPreparedCapacity,omitempty"`
	InstanceReusePolicy      InstanceReusePolicy `json:"InstanceReusePolicy"`
}

WarmPool represents a warm pool configuration for an Auto Scaling group.

type WarmPoolInput

type WarmPoolInput struct {
	AutoScalingGroupName     string
	PoolState                string
	MinSize                  int32
	MaxGroupPreparedCapacity int32
	InstanceReusePolicy      InstanceReusePolicy
}

WarmPoolInput holds the input for PutWarmPool.

Jump to

Keyboard shortcuts

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