AWS - vghn/docs GitHub Wiki

AWS

Systems Manager Parameter Store

aws ssm put-parameter --name a_name --value 'a value' --type SecureString

value="$(aws ssm get-parameter --name a_name --with-decryption --output text --query Parameter.Value)"

DynamoDB

Backup and restore with https://github.com/bchew/dynamodump

alias dynamodump='docker run --rm -it -v /tmp/dump:/dump bchew/dynamodump dynamodump'

dynamodump -m backup -s tableName -r us-east-1 --accessKey xxx --secretKey xxx
dynamodump -m restore -s tableName -r us-east-1 --accessKey yyy --secretKey yyy --dataOnly

AMIs

AMI cleaner

AWS_PROFILE=orion amicleaner --mapping-key name --mapping-values Prometheus --force-delete --full-report --keep-previous 1 --check-orphans

Use Packer inside a container in Windows

docker run --rm -it -v ${PWD}/Dropbox/Projects/amis:/amis -v ${PWD}/Dropbox/Projects/.secrets/.aws:/root/.aws -w /amis hashicorp/packer build packer/vault.json