aws iam list-users
aws iam get-user
aws iam list-access-keys
aws iam create-user --user-name username
aws iam create-policy --policy-name $POLICYNAME --policy-document file://${POLICY_JSON_FILE}
aws iam list-attached-role-policies --role-name $role_name | jq -r .AttachedPolicies[].PolicyArn
aws iam create-role --role-name $ROLENAME --assume-role-policy-document file://${ACCESS POLICY JSON DOC}
aws iam attach-role-policy --role-name $ROLENAME --policy-arn $POLICY_ARN
aws sts get-caller-identity
# list existing S3 buckets
aws s3 ls
# check if bucket exists or not
aws s3api head-bucket --bucket $bucketname
or
aws s3 ls | grep $bucket_name
# create a bucket
aws s3api create-bucket --bucket $bucket --region $region
# put object
aws s3api put-object --bucket $bucket --key logs/
#### copy a object
aws s3 cp file.txt s3://my-bucket/
#### copy to local
aws s3 cp s3://bucketname/somefile.txt .