autoscaling

package
v0.0.1-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package autoscaling provides metadata-level emulation of Amazon EC2 Auto Scaling.

Implemented operations (Query protocol, XML responses):

Auto Scaling Groups:
  CreateAutoScalingGroup, UpdateAutoScalingGroup,
  DescribeAutoScalingGroups, DeleteAutoScalingGroup,
  SetDesiredCapacity, TerminateInstanceInAutoScalingGroup

Launch Configurations:
  CreateLaunchConfiguration, DescribeLaunchConfigurations, DeleteLaunchConfiguration

Scaling Policies:
  PutScalingPolicy, DescribePolicies, DeletePolicy

Lifecycle Hooks:
  PutLifecycleHook, DescribeLifecycleHooks, DeleteLifecycleHook

Tags:
  CreateOrUpdateTags, DeleteTags, DescribeTags

Instances (metadata-only):
  DescribeAutoScalingInstances

All operations are metadata-only: no instances are launched, no scaling actions are executed, and no CloudWatch alarms are evaluated. This is sufficient to unblock CDK/Terraform stacks that reference ASG resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoScalingGroup

type AutoScalingGroup struct {
	AutoScalingGroupName    string    `json:"AutoScalingGroupName"`
	AutoScalingGroupARN     string    `json:"AutoScalingGroupARN"`
	LaunchConfigurationName string    `json:"LaunchConfigurationName,omitempty"`
	MinSize                 int       `json:"MinSize"`
	MaxSize                 int       `json:"MaxSize"`
	DesiredCapacity         int       `json:"DesiredCapacity"`
	DefaultCooldown         int       `json:"DefaultCooldown"`
	AvailabilityZones       []string  `json:"AvailabilityZones"`
	Status                  string    `json:"Status"`
	CreatedTime             time.Time `json:"CreatedTime"`
}

AutoScalingGroup represents an Auto Scaling group.

type GroupTag

type GroupTag struct {
	ResourceId        string `json:"ResourceId"`
	ResourceType      string `json:"ResourceType"`
	Key               string `json:"Key"`
	Value             string `json:"Value"`
	PropagateAtLaunch bool   `json:"PropagateAtLaunch"`
}

GroupTag represents a tag on an Auto Scaling group.

type Handler

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

Handler holds Auto Scaling handler dependencies.

func (*Handler) CreateAutoScalingGroup

func (h *Handler) CreateAutoScalingGroup(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateLaunchConfiguration

func (h *Handler) CreateLaunchConfiguration(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateOrUpdateTags

func (h *Handler) CreateOrUpdateTags(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteAutoScalingGroup

func (h *Handler) DeleteAutoScalingGroup(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteLaunchConfiguration

func (h *Handler) DeleteLaunchConfiguration(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteLifecycleHook

func (h *Handler) DeleteLifecycleHook(w http.ResponseWriter, r *http.Request)

func (*Handler) DeletePolicy

func (h *Handler) DeletePolicy(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteTags

func (h *Handler) DeleteTags(w http.ResponseWriter, r *http.Request)

func (*Handler) DescribeAutoScalingGroups

func (h *Handler) DescribeAutoScalingGroups(w http.ResponseWriter, r *http.Request)

func (*Handler) DescribeAutoScalingInstances

func (h *Handler) DescribeAutoScalingInstances(w http.ResponseWriter, r *http.Request)

func (*Handler) DescribeLaunchConfigurations

func (h *Handler) DescribeLaunchConfigurations(w http.ResponseWriter, r *http.Request)

func (*Handler) DescribeLifecycleHooks

func (h *Handler) DescribeLifecycleHooks(w http.ResponseWriter, r *http.Request)

func (*Handler) DescribePolicies

func (h *Handler) DescribePolicies(w http.ResponseWriter, r *http.Request)

func (*Handler) DescribeTags

func (h *Handler) DescribeTags(w http.ResponseWriter, r *http.Request)

func (*Handler) PutLifecycleHook

func (h *Handler) PutLifecycleHook(w http.ResponseWriter, r *http.Request)

func (*Handler) PutScalingPolicy

func (h *Handler) PutScalingPolicy(w http.ResponseWriter, r *http.Request)

func (*Handler) SetDesiredCapacity

func (h *Handler) SetDesiredCapacity(w http.ResponseWriter, r *http.Request)

func (*Handler) TerminateInstanceInAutoScalingGroup

func (h *Handler) TerminateInstanceInAutoScalingGroup(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateAutoScalingGroup

func (h *Handler) UpdateAutoScalingGroup(w http.ResponseWriter, r *http.Request)

type LaunchConfiguration

type LaunchConfiguration struct {
	LaunchConfigurationName string    `json:"LaunchConfigurationName"`
	LaunchConfigurationARN  string    `json:"LaunchConfigurationARN"`
	ImageId                 string    `json:"ImageId"`
	InstanceType            string    `json:"InstanceType"`
	KeyName                 string    `json:"KeyName,omitempty"`
	SecurityGroups          []string  `json:"SecurityGroups,omitempty"`
	IamInstanceProfile      string    `json:"IamInstanceProfile,omitempty"`
	UserData                string    `json:"UserData,omitempty"`
	CreatedTime             time.Time `json:"CreatedTime"`
}

LaunchConfiguration represents an EC2 Auto Scaling launch configuration.

type LifecycleHook

type LifecycleHook struct {
	LifecycleHookName    string `json:"LifecycleHookName"`
	AutoScalingGroupName string `json:"AutoScalingGroupName"`
	LifecycleTransition  string `json:"LifecycleTransition"`
	DefaultResult        string `json:"DefaultResult"`
	HeartbeatTimeout     int    `json:"HeartbeatTimeout"`
}

LifecycleHook represents a lifecycle hook.

type ScalingPolicy

type ScalingPolicy struct {
	PolicyARN            string `json:"PolicyARN"`
	PolicyName           string `json:"PolicyName"`
	AutoScalingGroupName string `json:"AutoScalingGroupName"`
	PolicyType           string `json:"PolicyType"`
	AdjustmentType       string `json:"AdjustmentType"`
	ScalingAdjustment    int    `json:"ScalingAdjustment"`
	Cooldown             int    `json:"Cooldown"`
}

ScalingPolicy represents a scaling policy.

type Service

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

Service implements router.Service and router.QueryDispatcher for Auto Scaling.

func New

func New(cfg *config.Config, st state.Store, logger *zap.Logger, clk clock.Clock) *Service

New returns a configured Auto Scaling Service.

func (*Service) DispatchQuery

func (s *Service) DispatchQuery(w http.ResponseWriter, r *http.Request)

DispatchQuery satisfies router.QueryDispatcher.

func (*Service) Name

func (s *Service) Name() string

Name satisfies router.Service.

func (*Service) Operations

func (s *Service) Operations() []op.Operation

Operations implements router.ProtocolService.

func (*Service) OwnsVersion

func (s *Service) OwnsVersion(v string) bool

OwnsVersion satisfies router.QueryVersionOwner.

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(_ chi.Router)

RegisterRoutes satisfies router.Service. All operations go through DispatchQuery.

func (*Service) SupportedProtocols

func (s *Service) SupportedProtocols() []codec.Codec

SupportedProtocols implements router.ProtocolService.

Jump to

Keyboard shortcuts

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