AWS S3: The bucket you are attempting to access must be addressed using the specified endpoint

It seems likely that this bucket was created in a different region, IE not us-west-2. That’s the only time I’ve seen “The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.” US Standard is us-east-1

How to handle errors with boto3?

Use the response contained within the exception. Here is an example: import boto3 from botocore.exceptions import ClientError try: iam = boto3.client(‘iam’) user = iam.create_user(UserName=”fred”) print(“Created user: %s” % user) except ClientError as e: if e.response[‘Error’][‘Code’] == ‘EntityAlreadyExists’: print(“User already exists”) else: print(“Unexpected error: %s” % e) The response dict in the exception will contain the … Read more

boto3 client NoRegionError: You must specify a region error only sometimes

One way or another you must tell boto3 in which region you wish the kms client to be created. This could be done explicitly using the region_name parameter as in: kms = boto3.client(‘kms’, region_name=”us-west-2″) or you can have a default region associated with your profile in your ~/.aws/config file as in: [default] region=us-west-2 or you … Read more

When to use Amazon Cloudfront or S3

Amazon S3 is designed for large-capacity, low-cost file storage in one specific geographical region.* The storage and bandwidth costs are quite low. Amazon CloudFront is a Content Delivery Network (CDN) which proxies and caches web data at edge locations as close to users as possible. When end users request an object using this domain name, … Read more

What data is stored in Ephemeral Storage of Amazon EC2 instance?

Basically, root volume (your entire virtual system disk) is ephemeral, but only if you choose to create AMI backed by Amazon EC2 instance store. If you choose to create AMI backed by EBS then your root volume is backed by EBS and everything you have on your root volume will be saved between reboots. If … Read more

S3 Static Website Hosting Route All Paths to Index.html

It’s very easy to solve it without url hacks, with CloudFront help. Create S3 bucket, for example: react Create CloudFront distributions with these settings: Default Root Object: index.html Origin Domain Name: S3 bucket domain, for example: react.s3.amazonaws.com Go to Error Pages tab, click on Create Custom Error Response: HTTP Error Code: 403: Forbidden (404: Not … Read more

AWS ssh access ‘Permission denied (publickey)’ issue [closed]

For Ubuntu instances: chmod 600 ec2-keypair.pem ssh -v -i ec2-keypair.pem ubuntu@ec2-174-129-185-190.compute-1.amazonaws.com For other instances, you might have to use ec2-user instead of ubuntu. Most EC2 Linux images I’ve used only have the root user created by default. See also: http://www.youtube.com/watch?v=WBro0TEAd7g

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