Created
September 10, 2015 09:57
-
-
Save seventhskye/c9ee9b86c7ea227770c0 to your computer and use it in GitHub Desktop.
Bash wrapper to create an Amazon Machine Image when logged into an instance. The IAM profile or keys must have the statement specified.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# "Statement": [ | |
# { | |
# "Effect": "Allow", | |
# "Action": [ | |
# "ec2:CreateImage", | |
# "ec2:RegisterImage" | |
# ], | |
# "Resource": "*" | |
# } | |
# ] | |
NAME= | |
DESCRIPTION= | |
aws ec2 create-image \ | |
--name $NAME-`date +%s` \ | |
--instance-id $(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id) \ | |
--description $DESCRIPTION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment