AWS CLI

Using AWS CLI

AWS CLI Basics: Assuming you have aws cli setup – if you are using an ec2 amazon AMI the AWS CLI is preinstalled for you – verify version of CLI with: aws –version # show the regions available – will work if you have ec2 privs… aws ec2 describe-regions –output text | cut -f 3 …

Using AWS CLI Read More »

AWS CLI s3api requires –create-bucket-configuration LocationConstraint=us-west-2 otherwise

When creating an S3 bucket with the AWS CLI s3api like: aws s3api create-bucket –bucket xxxxxredshiftoregon –region us-west-2 –create-bucket-configuration LocationConstraint=us-west-2 If you leave this “–create-bucket-configuration LocationConstraint=us-west-2” clause out you get an error like: An error occurred (IllegalLocationConstraintException) when calling the CreateBu cket operation: The unspecified location constraint is incompatible for the regi on specific endpoint …

AWS CLI s3api requires –create-bucket-configuration LocationConstraint=us-west-2 otherwise Read More »

aws cli install on windows and linux

so basically from a high level it is a two step process: 1.) install aws cli 2.) setup credentials and config file under “.aws” direct – slightly different default locations depending OS Both Windows and Linux AWS CLI depend on python and pip as prerequisites https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html or the more generic docs: https://docs.aws.amazon.com/cli/latest/userguide/installing.html After creating a …

aws cli install on windows and linux Read More »

Example aws cli command to write an item to DynamoDB table that exists

Example aws cli command to write an item to DynamoDB table that exists – put-item https://docs.aws.amazon.com/cli/latest/userguide/cli-dynamodb.html shorthand cli commands – shortens json https://docs.aws.amazon.com/cli/latest/userguide/shorthand-syntax.html My sample put-item to Contacts table aws dynamodb put-item \ –table-name Contacts \ –item ‘{ “ContactName”: {“S”: “JBird”}, “ContactSeq”: {“N”: 63} , “AlbumTitle”: {“S”: “Somewhat Famous”} }’ \ –return-consumed-capacity TOTAL { “ConsumedCapacity”: …

Example aws cli command to write an item to DynamoDB table that exists Read More »