On the road again

I will collect useful AWS commands here.

1. IAM

Create user:

aws iam create-user --user-name <user>

Set password for user:

aws iam create-login-profile --user-name grudev --password <password>

Create IAM group:

aws iam create-group --group-name admins

Add user to group:

aws iam add-user-to-group --group-name admins --user-name <user>

Set policy for group:

aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --group-name admins

 

2. S3 

Copy whole bucket to local folder:

aws s3 cp s3://source-bucket/prefix . --profile 5001120 --recursive

 Copy bucket to another bucket:

aws s3 sync s3://source-buclet/prefix s3://target-bucket --profile 5001120

Create bucket:

aws s3api create-bucket --bucket some-bucket --region eu-west-1 --profile 5001120 --create-bucket-configuration LocationConstraint=eu-west-1

 

3. Cloudformation

Check the results of stackset operation:

aws cloudformation list-stack-set-operation-results --stack-set-name <STACKSET_NAME> --operation-id <OPERATION_ID> --region us-east-1 --profile master 
Add comment