A simple script to start and stop in EC2 instances
Environment Variables When a Session is created several environment variables can be set to adjust how the SDK functions, and what configuration data it loads when creating Sessions. Environment configuration values. If set both Access Key ID and Secret Access Key must be provided.
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxx
AWS_ACCESS_KEY_ID=xxxxxxJust export them to your environment and lists3 will be able to read your buckets and generate the csv file successfully.
$ export AWS_SECRET_ACCESS_KEY=xxxxx
$ export AWS_ACCESS_KEY_ID=xxxxxAnother way to configure AWS is by creating the directory and ./aws/credentials file in your $ HOME and configuring it.
Check the contents of the file below:
[default]
aws_access_key_id = xxxxxx
aws_secret_access_key = xxxxxxxxTo execute just do the following:
$ go run start.go --region = us-east-1 --instance=i-05bef719c14d68d10
$ go run stop.go --region = us-east-1 --instance=i-05bef719c14d68d10or
$ go build
$ ./start --region=us-east-1 --instance=i-05bef719c14d68d10
$ ./stop --region=us-east-1 --instance=i-05bef719c14d68d10