Documentation
¶
Index ¶
- type AutoScalingGroup
- type AutoScalingInstance
- type AutoScalingService
- func (s *AutoScalingService) Actions() []service.Action
- func (s *AutoScalingService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
- func (s *AutoScalingService) HealthCheck() error
- func (s *AutoScalingService) Name() string
- func (s *AutoScalingService) SetEventBus(bus *eventbus.Bus)
- func (s *AutoScalingService) SetLocator(locator ServiceLocator)
- type LaunchConfiguration
- type LifecycleHook
- type ScalingPolicy
- type ScheduledAction
- type ServiceLocator
- type Store
- func (s *Store) AttachInstances(asgName string, instanceIDs []string) bool
- func (s *Store) CreateAutoScalingGroup(name, lcName, vpcZoneID, healthCheckType string, ...) (*AutoScalingGroup, bool)
- func (s *Store) CreateAutoScalingGroupWithEC2(name, lcName, vpcZoneID, healthCheckType string, ...) (*AutoScalingGroup, bool)
- func (s *Store) CreateLaunchConfiguration(name, imageID, instanceType, keyName, userData, iamProfile string, ...) (*LaunchConfiguration, bool)
- func (s *Store) CreateOrUpdateTags(tags []Tag)
- func (s *Store) DeleteAutoScalingGroup(name string) bool
- func (s *Store) DeleteAutoScalingGroupWithEC2(name string, locator ServiceLocator, bus *eventbus.Bus) bool
- func (s *Store) DeleteLaunchConfiguration(name string) bool
- func (s *Store) DeleteLifecycleHook(asgName, hookName string) bool
- func (s *Store) DeleteScalingPolicy(asgName, policyName string) bool
- func (s *Store) DeleteScheduledAction(asgName, actionName string) bool
- func (s *Store) DeleteTags(tags []Tag)
- func (s *Store) DescribeLifecycleHooks(asgName string, hookNames []string) []*LifecycleHook
- func (s *Store) DescribeScheduledActions(asgName string, actionNames []string) []*ScheduledAction
- func (s *Store) DetachInstances(asgName string, instanceIDs []string, decrementDesired bool) ([]*AutoScalingInstance, bool)
- func (s *Store) DisableMetricsCollection(asgName string) bool
- func (s *Store) EnableMetricsCollection(asgName, granularity string) bool
- func (s *Store) ExecutePolicy(asgName, policyName string) bool
- func (s *Store) GetAutoScalingGroup(name string) (*AutoScalingGroup, bool)
- func (s *Store) GetLaunchConfiguration(name string) (*LaunchConfiguration, bool)
- func (s *Store) ListAutoScalingGroups(names []string) []*AutoScalingGroup
- func (s *Store) ListAutoScalingInstances() []*AutoScalingInstance
- func (s *Store) ListLaunchConfigurations(names []string) []*LaunchConfiguration
- func (s *Store) ListScalingPolicies(asgName string, policyNames []string) []*ScalingPolicy
- func (s *Store) ListTags(asgName string) []Tag
- func (s *Store) PutLifecycleHook(...) (*LifecycleHook, bool)
- func (s *Store) PutScalingPolicy(asgName, policyName, policyType, adjustmentType string, ...) (*ScalingPolicy, bool)
- func (s *Store) PutScheduledAction(asgName, actionName, recurrence, startTime, endTime, timeZone string, ...) (*ScheduledAction, bool)
- func (s *Store) SetDesiredCapacity(name string, capacity int) bool
- func (s *Store) SetDesiredCapacityWithEC2(name string, capacity int, locator ServiceLocator, bus *eventbus.Bus) bool
- func (s *Store) UpdateAutoScalingGroup(name, lcName, vpcZoneID, healthCheckType string, ...) (*AutoScalingGroup, bool)
- func (s *Store) UpdateAutoScalingGroupWithEC2(name, lcName, vpcZoneID, healthCheckType string, ...) (*AutoScalingGroup, bool)
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoScalingGroup ¶
type AutoScalingGroup struct {
Name string
ARN string
LaunchConfigName string
LaunchTemplateID string
LaunchTemplateName string
MinSize int
MaxSize int
DesiredCapacity int
DefaultCooldown int
AvailabilityZones []string
TargetGroupARNs []string
HealthCheckType string
HealthCheckGracePeriod int
VPCZoneIdentifier string
Status string
Instances []*AutoScalingInstance
Tags map[string]string
CreatedTime time.Time
}
AutoScalingGroup represents an Auto Scaling group.
type AutoScalingInstance ¶
type AutoScalingInstance struct {
InstanceID string
AutoScalingGroupName string
AvailabilityZone string
LifecycleState string
HealthStatus string
LaunchConfigName string
ProtectedFromScaleIn bool
}
AutoScalingInstance represents an instance in an ASG.
type AutoScalingService ¶
type AutoScalingService struct {
// contains filtered or unexported fields
}
AutoScalingService is the cloudmock implementation of the AWS Auto Scaling API.
func New ¶
func New(accountID, region string) *AutoScalingService
New returns a new AutoScalingService for the given AWS account ID and region.
func NewWithLocator ¶
func NewWithLocator(accountID, region string, locator ServiceLocator) *AutoScalingService
NewWithLocator returns a new AutoScalingService with a service locator for cross-service communication.
func (*AutoScalingService) Actions ¶
func (s *AutoScalingService) Actions() []service.Action
Actions returns the list of Auto Scaling API actions supported by this service.
func (*AutoScalingService) HandleRequest ¶
func (s *AutoScalingService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
HandleRequest routes an incoming Auto Scaling request to the appropriate handler. Auto Scaling uses the query protocol (form-encoded, XML responses).
func (*AutoScalingService) HealthCheck ¶
func (s *AutoScalingService) HealthCheck() error
HealthCheck always returns nil (no external dependencies).
func (*AutoScalingService) Name ¶
func (s *AutoScalingService) Name() string
Name returns the AWS service name used for routing.
func (*AutoScalingService) SetEventBus ¶
func (s *AutoScalingService) SetEventBus(bus *eventbus.Bus)
SetEventBus sets the event bus for publishing autoscaling events.
func (*AutoScalingService) SetLocator ¶
func (s *AutoScalingService) SetLocator(locator ServiceLocator)
SetLocator sets the service locator for cross-service communication (EC2 instance creation).
type LaunchConfiguration ¶
type LaunchConfiguration struct {
Name string
ARN string
ImageID string
InstanceType string
KeyName string
SecurityGroups []string
UserData string
IAMInstanceProfile string
CreatedTime time.Time
}
LaunchConfiguration represents an Auto Scaling launch configuration.
type LifecycleHook ¶
type LifecycleHook struct {
LifecycleHookName string
AutoScalingGroupName string
LifecycleTransition string // autoscaling:EC2_INSTANCE_LAUNCHING or TERMINATING
NotificationTargetARN string
RoleARN string
NotificationMetadata string
HeartbeatTimeout int
DefaultResult string
}
LifecycleHook represents a lifecycle hook on an ASG.
type ScalingPolicy ¶
type ScalingPolicy struct {
Name string
ARN string
AutoScalingGroupName string
PolicyType string // SimpleScaling, StepScaling, TargetTrackingScaling
AdjustmentType string
ScalingAdjustment int
Cooldown int
TargetValue float64
MetricName string
Enabled bool
}
ScalingPolicy represents an Auto Scaling scaling policy.
type ScheduledAction ¶
type ScheduledAction struct {
ScheduledActionName string
ScheduledActionARN string
AutoScalingGroupName string
DesiredCapacity int
MinSize int
MaxSize int
Recurrence string
StartTime string
EndTime string
TimeZone string
}
ScheduledAction represents a scheduled scaling action.
type ServiceLocator ¶
ServiceLocator provides access to other services for cross-service communication.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages all Auto Scaling resources.
func (*Store) AttachInstances ¶
func (*Store) CreateAutoScalingGroup ¶
func (*Store) CreateAutoScalingGroupWithEC2 ¶
func (s *Store) CreateAutoScalingGroupWithEC2(name, lcName, vpcZoneID, healthCheckType string, minSize, maxSize, desiredCapacity, cooldown, hcGrace int, azs, tgARNs []string, tags map[string]string, locator ServiceLocator, bus *eventbus.Bus) (*AutoScalingGroup, bool)
CreateAutoScalingGroupWithEC2 creates an ASG and provisions instances via EC2 locator.
func (*Store) CreateLaunchConfiguration ¶
func (s *Store) CreateLaunchConfiguration(name, imageID, instanceType, keyName, userData, iamProfile string, securityGroups []string) (*LaunchConfiguration, bool)
func (*Store) CreateOrUpdateTags ¶
func (*Store) DeleteAutoScalingGroup ¶
func (*Store) DeleteAutoScalingGroupWithEC2 ¶
func (s *Store) DeleteAutoScalingGroupWithEC2(name string, locator ServiceLocator, bus *eventbus.Bus) bool
DeleteAutoScalingGroupWithEC2 deletes an ASG and terminates its EC2 instances.
func (*Store) DeleteLaunchConfiguration ¶
func (*Store) DeleteLifecycleHook ¶
DeleteLifecycleHook removes a lifecycle hook.
func (*Store) DeleteScalingPolicy ¶
func (*Store) DeleteScheduledAction ¶
DeleteScheduledAction removes a scheduled action.
func (*Store) DeleteTags ¶
func (*Store) DescribeLifecycleHooks ¶
func (s *Store) DescribeLifecycleHooks(asgName string, hookNames []string) []*LifecycleHook
DescribeLifecycleHooks returns lifecycle hooks for an ASG.
func (*Store) DescribeScheduledActions ¶
func (s *Store) DescribeScheduledActions(asgName string, actionNames []string) []*ScheduledAction
DescribeScheduledActions returns scheduled actions for an ASG.
func (*Store) DetachInstances ¶
func (*Store) DisableMetricsCollection ¶
DisableMetricsCollection disables metrics collection for an ASG.
func (*Store) EnableMetricsCollection ¶
EnableMetricsCollection enables metrics collection for an ASG.
func (*Store) ExecutePolicy ¶
ExecutePolicy simulates executing a scaling policy by adjusting desired capacity.
func (*Store) GetAutoScalingGroup ¶
func (s *Store) GetAutoScalingGroup(name string) (*AutoScalingGroup, bool)
func (*Store) GetLaunchConfiguration ¶
func (s *Store) GetLaunchConfiguration(name string) (*LaunchConfiguration, bool)
func (*Store) ListAutoScalingGroups ¶
func (s *Store) ListAutoScalingGroups(names []string) []*AutoScalingGroup
func (*Store) ListAutoScalingInstances ¶
func (s *Store) ListAutoScalingInstances() []*AutoScalingInstance
func (*Store) ListLaunchConfigurations ¶
func (s *Store) ListLaunchConfigurations(names []string) []*LaunchConfiguration
func (*Store) ListScalingPolicies ¶
func (s *Store) ListScalingPolicies(asgName string, policyNames []string) []*ScalingPolicy
func (*Store) PutLifecycleHook ¶
func (s *Store) PutLifecycleHook(asgName, hookName, transition, targetARN, roleARN, metadata, defaultResult string, heartbeatTimeout int) (*LifecycleHook, bool)
PutLifecycleHook creates or updates a lifecycle hook.
func (*Store) PutScalingPolicy ¶
func (*Store) PutScheduledAction ¶
func (s *Store) PutScheduledAction(asgName, actionName, recurrence, startTime, endTime, timeZone string, desiredCapacity, minSize, maxSize int) (*ScheduledAction, bool)
PutScheduledAction creates or updates a scheduled action.
func (*Store) SetDesiredCapacity ¶
func (*Store) SetDesiredCapacityWithEC2 ¶
func (s *Store) SetDesiredCapacityWithEC2(name string, capacity int, locator ServiceLocator, bus *eventbus.Bus) bool
SetDesiredCapacityWithEC2 sets desired capacity and reconciles via EC2.
func (*Store) UpdateAutoScalingGroup ¶
func (s *Store) UpdateAutoScalingGroup(name, lcName, vpcZoneID, healthCheckType string, minSize, maxSize, desiredCapacity, cooldown, hcGrace int) (*AutoScalingGroup, bool)
func (*Store) UpdateAutoScalingGroupWithEC2 ¶
func (s *Store) UpdateAutoScalingGroupWithEC2(name, lcName, vpcZoneID, healthCheckType string, minSize, maxSize, desiredCapacity, cooldown, hcGrace int, locator ServiceLocator, bus *eventbus.Bus) (*AutoScalingGroup, bool)
UpdateAutoScalingGroupWithEC2 updates an ASG and reconciles via EC2 if capacity changed.