How to rename AWS S3 Bucket

Solution aws s3 mb s3://[new-bucket] aws s3 sync s3://[old-bucket] s3://[new-bucket] aws s3 rb –force s3://[old-bucket] Explanation There’s no rename bucket functionality for S3 because there are technically no folders in S3 so we have to handle every file within the bucket. The code above will 1. create a new bucket, 2. copy files over and … Read more

What is the best way to pass AWS credentials to a Docker container?

A lot has changed in Docker since this question was asked, so here’s an attempt at an updated answer. First, specifically with AWS credentials on containers already running inside of the cloud, using IAM roles as Vor suggests is a really good option. If you can do that, then add one more plus one to … Read more

S3 Bucket action doesn’t apply to any resources

From IAM docs, http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Action Some services do not let you specify actions for individual resources; instead, any actions that you list in the Action or NotAction element apply to all resources in that service. In these cases, you use the wildcard * in the Resource element. With this information, resource should have a value like … Read more

How to test credentials for AWS Command Line Tools

Use GetCallerIdentity: aws sts get-caller-identity Unlike other API/CLI calls it will always work, regardless of your IAM permissions. You will get output in the following format: { “Account”: “123456789012”, “UserId”: “AR#####:#####”, “Arn”: “arn:aws:sts::123456789012:assumed-role/role-name/role-session-name” } Exact ARN format will depend on the type of credentials, but often includes the name of the (human) user. It uses … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)