Amazon Webservices
#useful awscli and other commands etc.
Find out who you are
aws sts get-caller-identity
Windows aws s3 cp
Download several files from a list of Filenams through a For-Each Loop in Powershell
Cloudformation
Deploy an EC2 Instance
The linked File deploys an EC2 Instance through Cloudformation EC2.yaml. Content for base64 raw UserData File:
Put this in a file called b64_content
. The Deployment script will base64 encode it and put replace the UserData
in the cloudformation script with it using sed
Deployment Script
Lambda
IAM
The file IAMUser.yaml creates a IAM User with admin privileges and programmatic access but no Login Access to the Managment Console. I use this user to deploy to my Laptops through ansible to have awscli Access without configuration overhead.
IAMUser.yaml To deploy the user to the StackName userStack
run, and use the describe-stack describe-stack-events
command to recieve the access-key
and secret-access-key
Deleting a Stack
To delete a Stack with stackName
run
aws cloudformation delete-stack --stack-name userStack
cloudfront
Create a list of all cloudfront distributions
Explanation: .
takes all elemens {"Id" : ."Id"}
creates an object with the Key "Id" and the value of Id
from the List it gets passed jq -c
: Does not print a new Line after every Element ##Cloudwatch List all metrics where the Namespace contains Usage
Last updated