aws-auto-scaling-set-desired-capacity
Modifies the desired instance count for an AWS Auto Scaling group.
Syntax
aws-auto-scaling-set-desired-capacity profile=STRING region=STRING name=STRING capacity=INT
Options
- profile=STRING
- Required option. The identifier of AWS connect profile
- region=STRING
- Required option. AWS region
- name=STRING
- Required option. Autoscaling group name
- capacity=INT
- Required option. Desired capacity
Output fields
| Field | Type | Name | Description |
|---|---|---|---|
| aws_profile | string | Connect profile | The identifier of AWS connect profile |
| region | string | Region | e.g. ap-northeast-2 |
| name | string | Autoscaling group name | |
| capacity | int | Desired capacity | |
| status | int | HTTP status | e.g. 200 |
Error codes
Parse errors
| Error message | Cause | Resolution |
|---|---|---|
| aws-profile-not-found | No AWS connect profile matches the name given in the profile option. | Check the name on Settings > Connect Profiles and specify it again. |
| no-permission | The account running the query is not granted the connect profile. | Ask an administrator to grant the connect profile. |
| invalid-aws-region | The region option value is not an AWS region name. | Enter an exact AWS region name such as ap-northeast-2. |
| use-one-aws-profile | More than one connect profile was given in the profile option. | Specify a single connect profile. |
| Specify AWS profile name to aws-auto-scaling-set-desired-capacity command | Option validation failed. | Specify AWS profile name to aws-auto-scaling-set-desired-capacity command |
| Specify region to aws-auto-scaling-set-desired-capacity command | Option validation failed. | Specify region to aws-auto-scaling-set-desired-capacity command |
| Specify group name to aws-auto-scaling-set-desired-capacity command. | Option validation failed. | Specify group name to aws-auto-scaling-set-desired-capacity command. |
| Specify capacity to aws-auto-scaling-set-desired-capacity command. | Option validation failed. | Specify capacity to aws-auto-scaling-set-desired-capacity command. |
| Specify non-negative capacity number to aws-auto-scaling-set-desired-capacity command. | A negative capacity was given. | Enter an integer of 0 or more. |
Description
Modifies the desired instance count for an AWS Auto Scaling group.
The following AWS IAM permissions must be allowed to use this command.
- autoscaling:SetDesiredCapacity
Caution
This command changes an AWS resource rather than reading one. The change takes effect as soon as the query runs and is not rolled back automatically.
Examples
Example: Update AWS Auto Scaling Group Capacity
Situation: A detection rule or playbook needs to run update aws auto scaling group capacity.
aws-auto-scaling-set-desired-capacity profile=aws-prod region=ap-northeast-2 name=example-ip-set capacity=2
Expected result:
| aws_profile | region | name | capacity |
|---|---|---|---|
| aws-prod | ap-northeast-2 | example-name | 1 |
Interpretation: One record is the outcome of one request. The command changes an AWS resource, so verify the target identifier and region before running it.