If you have have an autoscaling group, how do you go about start/stopping the instances (not launch/terminate) ? The default behaviour is only for launching an
You may consider to run your script using AWS Data Pipeline.
Use this script to retrieve instance ID as well as availability zone and region, etc
Choose Create New Pipeline and enter the following information:
Name: for example, "Start EC2 instances" and "Stop EC2 instances". Description: Provide relevant details about the pipeline as needed. Source: Choose Build using template and choose the template Run AWS CLI command. AWS CLI command: This is where you put your script to specify what the pipeline does.
Configure each pipeline with appropriate scheduling information.
Run: Choose on activation to run the pipeline as an on-demand pipeline. Run every: Enter a period for every pipeline run. Starting: Enter a time and date for the pipeline to start. Ending: Enter a time and date for the pipeline to end.
Set the following options for implementing appropriate security access:
IAM Roles: Choose Custom Pipeline Role: DataPipelineDefaultRole EC2 Instance Role: DataPipelineDefaultResourceRole
Note that Data Pipeline creates the necessary IAM Roles for you.
For more information, see AWS Data Pipeline Pricing.
See also other option using AWS Lambda.