Answers: <p>I just solved it using put-scheduled-update-group-action</p>
  <p>aws autoscaling put-scheduled-update-group-action --auto-scaling-group-name temp_4_jenkins --scheduled-action-name training --start-time 2020-11-23T09:10:00Z --min-size 0 --max-size 0 --desired-capacity 0 --region eu-west-1 --output json</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-11-22T16:13:49.230Z
Answers: 2020-11-22T16:13:49.230Z
Answers: doug
Body: <p>my scheduled action is called training
  my ASG is called temp_4_jenkins as I was planning to set up a pipeline on a Jenkins on my personal account to run the CLI commands.</p>
  <pre><code>aws application-autoscaling put-scheduled-action --service-namespace ec2 \
    --scalable-dimension ec2:instance:1 \
    --resource-id instance/t2.micro \
    --scheduled-action-name training \
    --schedule &quot;cron(10 9 * * *)&quot; \
    --scalable-target-action MinCapacity=0,MaxCapacity=0
  </code></pre>
  <p>I get back the error</p>
  <p>An error occurred (ValidationException) when calling the PutScheduledAction operation: 1 validation error detected: Value 'ec2:instance:1' at 'scalableDimension' failed to satisfy constraint: Member must satisfy enum value set: [cassandra:table:ReadCapacityUnits, dynamodb:table:ReadCapacityUnits, dynamodb:index:ReadCapacityUnits, rds:cluster:ReadReplicaCount, comprehend:document-classifier-endpoint:DesiredInferenceUnits, elasticmapreduce:instancefleet:SpotCapacity, lambda:function:ProvisionedConcurrency, comprehend:entity-recognizer-endpoint:DesiredInferenceUnits, appstream:fleet:DesiredCapacity, dynamodb:index:WriteCapacityUnits, elasticmapreduce:instancefleet:OnDemandCapacity, rds:cluster:Capacity, cassandra:table:WriteCapacityUnits, dynamodb:table:WriteCapacityUnits, elasticache:replication-group:Shards, custom-resource:ResourceType:Property, sagemaker:variant:DesiredInstanceCount, kafka:broker-storage:VolumeSize, ec2:spot-fleet-request:TargetCapacity, elasticache:replication-group:Replicas, elasticmapreduce:instancegroup:InstanceCount, ecs:service:DesiredCount]</p>
  <p>I found the command in the docs
  <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html</a></p>
  <p>Then tried to modify it to ec2s instances?</p>
  <p>I might be missing something obvious but why is the error talking about RDS and fleets I want to edit the schedule on my auto-scaling group to change the number of ec2s that get spun up?</p>
  
Tags: <aws-cli><asg>
Title: How do I edit my AWS ASG scheduled action useing the aws CLI
UserDisplayName: doug
ThreadText: # How do I edit my AWS ASG scheduled action useing the aws CLI
  
  (Asked by: username_0 on 2020-11-22)
  
  my scheduled action is called training
  my ASG is called temp\_4\_jenkins as I was planning to set up a pipeline on a Jenkins on my personal account to run the CLI commands.
  
  ```
  aws application-autoscaling put-scheduled-action --service-namespace ec2 \
    --scalable-dimension ec2:instance:1 \
    --resource-id instance/t2.micro \
    --scheduled-action-name training \
    --schedule "cron(10 9 * * *)" \
    --scalable-target-action MinCapacity=0,MaxCapacity=0
  
  ```
  
  I get back the error
  
  An error occurred (ValidationException) when calling the PutScheduledAction operation: 1 validation error detected: Value 'ec2:instance:1' at 'scalableDimension' failed to satisfy constraint: Member must satisfy enum value set: [cassandra:table:ReadCapacityUnits, dynamodb:table:ReadCapacityUnits, dynamodb:index:ReadCapacityUnits, rds:cluster:ReadReplicaCount, comprehend:document-classifier-endpoint:DesiredInferenceUnits, elasticmapreduce:instancefleet:SpotCapacity, lambda:function:ProvisionedConcurrency, comprehend:entity-recognizer-endpoint:DesiredInferenceUnits, appstream:fleet:DesiredCapacity, dynamodb:index:WriteCapacityUnits, elasticmapreduce:instancefleet:OnDemandCapacity, rds:cluster:Capacity, cassandra:table:WriteCapacityUnits, dynamodb:table:WriteCapacityUnits, elasticache:replication-group:Shards, custom-resource:ResourceType:Property, sagemaker:variant:DesiredInstanceCount, kafka:broker-storage:VolumeSize, ec2:spot-fleet-request:TargetCapacity, elasticache:replication-group:Replicas, elasticmapreduce:instancegroup:InstanceCount, ecs:service:DesiredCount]
  
  I found the command in the docs
  <https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html>
  
  Then tried to modify it to ec2s instances?
  
  I might be missing something obvious but why is the error talking about RDS and fleets I want to edit the schedule on my auto-scaling group to change the number of ec2s that get spun up?
  
  **Tags:** aws-cli, asg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-11-22. Score: 1
  
  I just solved it using put-scheduled-update-group-action
  
  aws autoscaling put-scheduled-update-group-action --auto-scaling-group-name temp\_4\_jenkins --scheduled-action-name training --start-time 2020-11-23T09:10:00Z --min-size 0 --max-size 0 --desired-capacity 0 --region eu-west-1 --output json
  
  
  ---
  
  