How to rename AWS S3 Bucket

After all the tough work of migration etc, I just realised that I need to serve the content using CNAME (e.g media.abc.com). The bucket name needs to start with media.abc.com/S3/amazon.com to ensure it works perfectly. I just realised that S3 doesn’t allow direct rename from the console. Is there any way to work around this? … Read more

S3 Bucket action doesn’t apply to any resources

I’m following the instructions from this answer to generate the follow S3 bucket policy: { “Id”: “Policy1495981680273”, “Version”: “2012-10-17”, “Statement”: [ { “Sid”: “Stmt1495981517155”, “Action”: [ “s3:GetObject” ], “Effect”: “Allow”, “Resource”: “arn:aws:s3:::surplace-audio”, “Principal”: “*” } ] } I get back the following error: Action does not apply to any resource(s) in statement What am I … Read more

How can I tell how many objects I’ve stored in an S3 bucket?

Unless I’m missing something, it seems that none of the APIs I’ve looked at will tell you how many objects are in an <S3 bucket>/<folder>. Is there any way to get a count? 32 Answers 32 Using AWS CLI aws s3 ls s3://mybucket/ –recursive | wc -l or aws cloudwatch get-metric-statistics \ –namespace AWS/S3 –metric-name … Read more

How to choose an AWS profile when using boto3 to connect to CloudFront

I am using the Boto 3 python library, and want to connect to AWS CloudFront. I need to specify the correct AWS Profile (AWS Credentials), but looking at the official documentation, I see no way to specify it. I am initializing the client using the code: client = boto3.client(‘cloudfront’) However, this results in it using … Read more

AWS VPC – Internet Gateway vs. NAT [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions about professional server or networking-related infrastructure administration on Stack Overflow. You can edit the question so it’s on-topic for Stack Overflow. Closed 4 years ago. Improve this question What is an Internet Gateway? What is a … Read more

WARNING: UNPROTECTED PRIVATE KEY FILE! when trying to SSH into Amazon EC2 Instance

I’m working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no problem using SSH to interact with my own personal instance, but right now I’m not being allowed permission into Panda’s EC2 instance. Getting Started with Panda I’m getting the following error: @ … Read more

How to test credentials for AWS Command Line Tools

Is there a command/subcommand that can be passed to the aws utility that can 1) verify that the credentials in the ~/.aws/credentials file are valid, and 2) give some indication which user the credentials belong to? I’m looking for something generic that doesn’t make any assumptions about the user having permissions to IAM or any … Read more