Skip to content

stratumctl asg

Auto Scaling Groups + Launch Templates

Terminal window
stratumctl asg [flags]

Auto scaling groups

Terminal window
stratumctl asg groups [flags]

Aliases: group

Attach existing instances (desired grows by the count)

Terminal window
stratumctl asg groups attach <asg-id> <instance-id>... [flags]
Terminal window
stratumctl asg groups attach asg-3k8m2x7q9a i-uy3ureaklq
stratumctl asg groups attach asg-3k8m2x7q9a i-uy3ureaklq i-5mq8x2ab4k
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Create an auto scaling group

Terminal window
stratumctl asg groups create <name> [flags]
Terminal window
stratumctl asg groups create web --launch-template lt-4k8m2x7q9a --min 2 --max 6 --subnet subnet-3k8m2x7q
stratumctl asg groups create web --launch-template lt-4k8m2x7q9a --min 2 --max 6 --desired 3 --subnet subnet-3k8m2x7q --subnet subnet-6k2m8x4q \
--create-lb --lb-port 8080
Flag Type Default Description
--cooldown int -1 Default cooldown in seconds (policy-driven changes)
--create-lb bool false Own the front door: the service creates a target group, a load balancer and a listener for the group
--description string Description
--desired int -1 Desired size (default min)
--grace int -1 Health-check grace period in seconds
--health-check string instance | load_balancer
--launch-template string Launch template id
--launch-template-version string $LATEST | $DEFAULT | ltv-… (default $LATEST)
--lb-certificate string SSL certificate id (cert-…) of this project: makes the listener HTTPS, terminated with it; a change replaces the listener
--lb-health-path string HTTP health-check path on the members (default: the load balancer’s)
--lb-listener-port int 0 The listener’s port (default: –lb-port; 443 with –lb-certificate)
--lb-port int 0 The port the members serve on (default 80)
--lb-protocol string HTTP | HTTPS | TCP (default HTTP)
--lb-scheme string internet-facing | internal (default internet-facing)
--max int 0 Maximum size
--min int 0 Minimum size
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--subnet stringArray Subnet id, one VPC (repeatable)
--tag stringArray Tag key=value (repeatable)
--target-group stringArray Load-balancer target group id (repeatable)
--termination-policy stringArray OldestInstance | NewestInstance | OldestLaunchTemplate | ClosestToNextInstanceHour | Default (repeatable, ordered)

Delete a group (its instances drain and terminate; the group disappears when done)

Terminal window
stratumctl asg groups delete <asg-id> [flags]
Terminal window
stratumctl asg groups delete asg-3k8m2x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Describe an auto scaling group

Terminal window
stratumctl asg groups describe <asg-id> [flags]

Aliases: get

Terminal window
stratumctl asg groups describe asg-3k8m2x7q9a
stratumctl asg groups describe asg-3k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Detach members (they keep running; a replacement launches unless –decrement)

Terminal window
stratumctl asg groups detach <asg-id> <instance-id>... [flags]
Terminal window
stratumctl asg groups detach asg-3k8m2x7q9a i-uy3ureaklq
stratumctl asg groups detach asg-3k8m2x7q9a i-uy3ureaklq --decrement
Flag Type Default Description
--decrement bool false Shrink desired size instead of launching replacements
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List a group’s member instances

Terminal window
stratumctl asg groups instances <asg-id> [flags]
Terminal window
stratumctl asg groups instances asg-3k8m2x7q9a
stratumctl asg groups instances asg-3k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List auto scaling groups

Terminal window
stratumctl asg groups list [flags]
Terminal window
stratumctl asg groups list
stratumctl asg groups list --limit 20 --output json
Flag Type Default Description
--limit int 0 Page size; setting it (or –page-token) returns one page and prints the next token instead of listing everything
--page-token string Cursor from a previous page; returns that one page
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Protect members from scale-in (–off to clear)

Terminal window
stratumctl asg groups protect <asg-id> <instance-id>... [flags]
Terminal window
stratumctl asg groups protect asg-3k8m2x7q9a i-uy3ureaklq
stratumctl asg groups protect asg-3k8m2x7q9a i-uy3ureaklq --off
Flag Type Default Description
--off bool false Remove the protection
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Resume suspended scaling processes

Terminal window
stratumctl asg groups resume <asg-id> [flags]
Terminal window
stratumctl asg groups resume asg-3k8m2x7q9a
stratumctl asg groups resume asg-3k8m2x7q9a --process Launch --process Terminate
Flag Type Default Description
--process stringArray Process name (repeatable; omit for all)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Set the desired size now (bypasses cooldown)

Terminal window
stratumctl asg groups set-desired <asg-id> <n> [flags]
Terminal window
stratumctl asg groups set-desired asg-3k8m2x7q9a 4
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Suspend scaling processes (Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer, InstanceRefresh)

Terminal window
stratumctl asg groups suspend <asg-id> [flags]
Terminal window
stratumctl asg groups suspend asg-3k8m2x7q9a
stratumctl asg groups suspend asg-3k8m2x7q9a --process Launch --process Terminate
Flag Type Default Description
--process stringArray Process name (repeatable; omit for all)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Update an auto scaling group (only the flags given change)

Terminal window
stratumctl asg groups update <asg-id> [flags]
Terminal window
stratumctl asg groups update asg-3k8m2x7q9a --min 3 --max 10
stratumctl asg groups update asg-3k8m2x7q9a --launch-template lt-4k8m2x7q9a --launch-template-version '$LATEST'
Flag Type Default Description
--cooldown int -1 Default cooldown in seconds (policy-driven changes)
--create-lb bool false Own the front door: the service creates a target group, a load balancer and a listener for the group
--description string Description
--desired int -1 Desired size (default min)
--grace int -1 Health-check grace period in seconds
--health-check string instance | load_balancer
--launch-template string Launch template id
--launch-template-version string $LATEST | $DEFAULT | ltv-… (default $LATEST)
--lb-certificate string SSL certificate id (cert-…) of this project: makes the listener HTTPS, terminated with it; a change replaces the listener
--lb-health-path string HTTP health-check path on the members (default: the load balancer’s)
--lb-listener-port int 0 The listener’s port (default: –lb-port; 443 with –lb-certificate)
--lb-port int 0 The port the members serve on (default 80)
--lb-protocol string HTTP | HTTPS | TCP (default HTTP)
--lb-scheme string internet-facing | internal (default internet-facing)
--max int 0 Maximum size
--min int 0 Minimum size
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--remove-lb bool false Tear the owned front door down (the group keeps running)
--subnet stringArray Subnet id, one VPC (repeatable)
--tag stringArray Tag key=value (repeatable)
--target-group stringArray Load-balancer target group id (repeatable)
--termination-policy stringArray OldestInstance | NewestInstance | OldestLaunchTemplate | ClosestToNextInstanceHour | Default (repeatable, ordered)

Lifecycle hooks: pause launches or terminations until answered

Terminal window
stratumctl asg hooks [flags]

Aliases: hook

Complete a lifecycle action for an instance the hook holds (CONTINUE | ABANDON)

Terminal window
stratumctl asg hooks complete <asg-id> <hook-name> [flags]
Terminal window
stratumctl asg hooks complete asg-3k8m2x7q9a pre-boot --instance i-uy3ureaklq
stratumctl asg hooks complete asg-3k8m2x7q9a drain --instance i-uy3ureaklq --result ABANDON
Flag Type Default Description
--instance string Instance id the hook holds (required)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--result string CONTINUE CONTINUE | ABANDON

Delete a lifecycle hook (held instances continue)

Terminal window
stratumctl asg hooks delete <asg-id> <name> [flags]
Terminal window
stratumctl asg hooks delete asg-3k8m2x7q9a pre-boot
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Describe a lifecycle hook

Terminal window
stratumctl asg hooks describe <asg-id> <name> [flags]

Aliases: get

Terminal window
stratumctl asg hooks describe asg-3k8m2x7q9a pre-boot
stratumctl asg hooks describe asg-3k8m2x7q9a pre-boot --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Extend the wait for an instance the hook holds

Terminal window
stratumctl asg hooks heartbeat <asg-id> <hook-name> [flags]
Terminal window
stratumctl asg hooks heartbeat asg-3k8m2x7q9a pre-boot --instance i-uy3ureaklq
Flag Type Default Description
--instance string Instance id the hook holds (required)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List a group’s lifecycle hooks

Terminal window
stratumctl asg hooks list <asg-id> [flags]
Terminal window
stratumctl asg hooks list asg-3k8m2x7q9a
stratumctl asg hooks list asg-3k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Create or replace a lifecycle hook

Terminal window
stratumctl asg hooks put <asg-id> <name> [flags]
Terminal window
stratumctl asg hooks put asg-… pre-boot --transition launching --timeout 600
stratumctl asg hooks put asg-… drain --transition terminating --default-result ABANDON --timeout 120
Flag Type Default Description
--default-result string CONTINUE | ABANDON when the hook times out (default CONTINUE)
--metadata string Notification metadata as JSON
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--timeout int 0 Heartbeat timeout in seconds (30-7200; default 3600)
--transition string launching | terminating (required)

Launch templates: versioned instance blueprints

Terminal window
stratumctl asg launch-templates [flags]

Aliases: lt

Create a launch template with its first version

Terminal window
stratumctl asg launch-templates create <name> [flags]
Terminal window
stratumctl asg launch-templates create web-lt --image img-k3m9x2abqt --type m1.medium
stratumctl asg launch-templates create web-lt --image img-k3m9x2abqt --type m1.medium --key-pair axel-laptop \
--security-group sg-3f8d2k9x --user-data-file cloud.yaml --tag-at-launch env=prod
Flag Type Default Description
--description string Description
--floating-ip-pool string Floating-IP pool to allocate a public address from
--image string Image id (required)
--instance-profile string IAM instance profile id
--key-pair string Key pair name
--no-agent bool false Launch with the instance agent disabled
--placement-group string Placement group name
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--root-size-bytes int64 0 Root volume size in bytes
--root-storage-class string Root volume storage class
--security-group stringArray Security group id (repeatable)
--subnet string Subnet id (static placement); omit to inherit the group’s subnets
--subnet-strategy string static | inherited (defaults from –subnet)
--tag stringArray Tag key=value on the template (repeatable)
--tag-at-launch stringArray Tag key=value stamped on launched instances (repeatable)
--type string Instance type name, e.g. m1.medium (required)
--user-data-file string Path to the cloud-config user-data (or - for stdin)
--version-description string Version description

Delete a launch template (refused while a group references it)

Terminal window
stratumctl asg launch-templates delete <launch-template-id> [flags]
Terminal window
stratumctl asg launch-templates delete lt-4k8m2x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Describe a launch template

Terminal window
stratumctl asg launch-templates describe <launch-template-id> [flags]

Aliases: get

Terminal window
stratumctl asg launch-templates describe lt-4k8m2x7q9a
stratumctl asg launch-templates describe lt-4k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List launch templates

Terminal window
stratumctl asg launch-templates list [flags]
Terminal window
stratumctl asg launch-templates list
stratumctl asg launch-templates list --limit 20 --output json
Flag Type Default Description
--limit int 0 Page size; setting it (or –page-token) returns one page and prints the next token instead of listing everything
--page-token string Cursor from a previous page; returns that one page
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

stratumctl asg launch-templates set-default

Section titled “stratumctl asg launch-templates set-default”

Move $DEFAULT to a version

Terminal window
stratumctl asg launch-templates set-default <launch-template-id> <version-id> [flags]
Terminal window
stratumctl asg launch-templates set-default lt-4k8m2x7q9a ltv-5k8m2x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Update a launch template’s description and tags

Terminal window
stratumctl asg launch-templates update <launch-template-id> [flags]
Terminal window
stratumctl asg launch-templates update lt-4k8m2x7q9a --description "web tier"
stratumctl asg launch-templates update lt-4k8m2x7q9a --tag env=prod --tag team=a
Flag Type Default Description
--description string Description (empty clears)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--tag stringArray Tag key=value; the full set replaces the old (repeatable)

stratumctl asg launch-templates version-create

Section titled “stratumctl asg launch-templates version-create”

Add a version ($LATEST moves to it)

Terminal window
stratumctl asg launch-templates version-create <launch-template-id> [flags]
Terminal window
stratumctl asg launch-templates version-create lt-4k8m2x7q9a --image img-5k8m2x7q9a --type m1.medium
stratumctl asg launch-templates version-create lt-4k8m2x7q9a --image img-5k8m2x7q9a --type m1.large --version-description "bigger shape"
Flag Type Default Description
--floating-ip-pool string Floating-IP pool to allocate a public address from
--image string Image id (required)
--instance-profile string IAM instance profile id
--key-pair string Key pair name
--no-agent bool false Launch with the instance agent disabled
--placement-group string Placement group name
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--root-size-bytes int64 0 Root volume size in bytes
--root-storage-class string Root volume storage class
--security-group stringArray Security group id (repeatable)
--subnet string Subnet id (static placement); omit to inherit the group’s subnets
--subnet-strategy string static | inherited (defaults from –subnet)
--tag-at-launch stringArray Tag key=value stamped on launched instances (repeatable)
--type string Instance type name, e.g. m1.medium (required)
--user-data-file string Path to the cloud-config user-data (or - for stdin)
--version-description string Version description

stratumctl asg launch-templates version-delete

Section titled “stratumctl asg launch-templates version-delete”

Delete a version (not $DEFAULT, not the last, not one a group uses)

Terminal window
stratumctl asg launch-templates version-delete <launch-template-id> <version-id> [flags]
Terminal window
stratumctl asg launch-templates version-delete lt-4k8m2x7q9a ltv-5k8m2x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

stratumctl asg launch-templates version-describe

Section titled “stratumctl asg launch-templates version-describe”

Describe a version (user-data included)

Terminal window
stratumctl asg launch-templates version-describe <launch-template-id> <version-id> [flags]
Terminal window
stratumctl asg launch-templates version-describe lt-4k8m2x7q9a ltv-5k8m2x7q9a
stratumctl asg launch-templates version-describe lt-4k8m2x7q9a ltv-5k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List a launch template’s versions

Terminal window
stratumctl asg launch-templates versions <launch-template-id> [flags]
Terminal window
stratumctl asg launch-templates versions lt-4k8m2x7q9a
stratumctl asg launch-templates versions lt-4k8m2x7q9a --output json
Flag Type Default Description
--limit int 0 Page size; setting it (or –page-token) returns one page and prints the next token instead of listing everything
--page-token string Cursor from a previous page; returns that one page
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Scaling policies: target-tracking, step, scheduled

Terminal window
stratumctl asg policies [flags]

Aliases: policy

Delete a scaling policy

Terminal window
stratumctl asg policies delete <asg-id> <name> [flags]
Terminal window
stratumctl asg policies delete asg-3k8m2x7q9a cpu
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Describe a scaling policy with its last evaluation

Terminal window
stratumctl asg policies describe <asg-id> <name> [flags]

Aliases: get

Terminal window
stratumctl asg policies describe asg-3k8m2x7q9a cpu
stratumctl asg policies describe asg-3k8m2x7q9a cpu --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List a group’s scaling policies

Terminal window
stratumctl asg policies list <asg-id> [flags]
Terminal window
stratumctl asg policies list asg-3k8m2x7q9a
stratumctl asg policies list asg-3k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Create or replace a scaling policy

Terminal window
stratumctl asg policies put <asg-id> <name> [flags]
Terminal window
stratumctl asg policies put asg-… cpu --kind target_tracking --config-json '{"metricName":"stratum_compute_instance_cpu_percent","targetValue":60}'
stratumctl asg policies put asg-… nightly --kind scheduled --config-json '{"scheduleCron":"0 22 * * *","desiredSize":1}'
Flag Type Default Description
--config-file string Path to the config JSON (or - for stdin)
--config-json string Kind-specific config as JSON
--disabled bool false Store the policy disabled
--kind string target_tracking | step | scheduled (required)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Instance refreshes: roll a group to a launch-template version

Terminal window
stratumctl asg refresh [flags]

Cancel a refresh after its in-flight batch

Terminal window
stratumctl asg refresh cancel <asg-id> <refresh-id> [flags]
Terminal window
stratumctl asg refresh cancel asg-3k8m2x7q9a ir-6k2m8x4q7a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Describe a refresh

Terminal window
stratumctl asg refresh describe <asg-id> <refresh-id> [flags]

Aliases: get

Terminal window
stratumctl asg refresh describe asg-3k8m2x7q9a ir-6k2m8x4q7a
stratumctl asg refresh describe asg-3k8m2x7q9a ir-6k2m8x4q7a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List a group’s refreshes, newest first

Terminal window
stratumctl asg refresh list <asg-id> [flags]
Terminal window
stratumctl asg refresh list asg-3k8m2x7q9a
stratumctl asg refresh list asg-3k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Start a rolling replacement toward a launch-template version

Terminal window
stratumctl asg refresh start <asg-id> [flags]
Terminal window
stratumctl asg refresh start asg-3k8m2x7q9a
stratumctl asg refresh start asg-3k8m2x7q9a --target ltv-5k8m2x7q9a --max-batch 2 --min-healthy 75
Flag Type Default Description
--max-batch int 1 Instances replaced per pass
--min-healthy int 90 Healthy floor as a percentage of desired size
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--target string $LATEST | $DEFAULT | ltv-… (default: the group’s reference as it resolves now)
--warmup int 0 Seconds a replacement must be InService before it counts (default: the group’s grace)