Unable to delete Amazon S3 Bucket - amazon-web-services

Please help to delete s3 bucket.
I have created Kubernetes Cluster during cluster build created S3 bucket, after deleting cluster unable to delete S3 bucket.
when tried to delete from S3 console getting Unknown Error (An unexpected error occurred).
Tried to delete by aws s3 rb s3://<bucket name> --force getting below error
fatal error: An error occurred (NoSuchBucket) when calling the ListObjects operation: The specified bucket does not exist
Tried to run aws s3 rm s3://<bucket name>/foo*
But no luck in resolving the issue could you please help to me to resove the issue.

Related

"aws s3 cp" gets error while "aws s3 ls" works?

Our client shared a S3 bucket to us. The following command to list the objects works.
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... aws s3 ls s3://bucket/company4/obj1
But it got 403 error when downloading?
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... aws s3 cp s3://bucket/company4/obj1 .
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden
The issue was caused by missing proxy. It works after setting the proxy export http_proxy=.... Why aws s3 ls doesn't require proxy?

AWS CLI command to copy files from s3 to local machine fails with InvalidAccessKeyId

Hi folks I am following a tutorial on the AWS platform and I am stuck at a point where I have to copy some files from an s3 to local machine. I used the following command to do that:
aws s3 cp s3://wildrydes-us-east-1/WebApplication/1_StaticWebHosting/website ./ --recursive
However what I get is an error:
fatal error: An error occurred (InvalidAccessKeyId) when calling the ListObjectsV2 operation: The AWS Access Key Id you provided does not exist in our records.

AWS CLI returning No Such Bucket exists but I can see the bucket in the console

Trying to learn terraform and running through some examples from their documentation. I am trying to move a file from my pc to a S3 bucket. I create this bucket with the command:
aws s3api create-bucket --bucket=terraform-serverless-example --region=us-east-1
If I then check on the console or call the s3api list-buckets I can see it exists and is functional. I can also upload using the console. However when I try to run this command:
aws s3 cp example.zip s3://terraform-serverless-example/v1.0.0/example.zip
It returns this error:
upload failed: ./code.zip to s3://test-verson1/v1.0.0/code.zip An error occurred (NoSuchBucket) when calling the PutObject operation: The specified bucket does not exist
I have tried to configure the region by adding it as a flag, have made sure permissions are correct and so on and it's all set up as should be. I cant figure out why this maybe and would appreciate any help.

AWS s3 rb doesn't work in the CLI, how do I delete files in my s3 bucket?

I need to delete my s3 bucket
Versioning is disabled as the version id for each file is set to null.
When I enter
aws s3 rb s3://bucketname --force
It ends with the following output
remove_bucket failed: s3://bucketname An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty. You must delete all versions in the bucket.
How can I permanently delete the bucket and its via the AWS CLI?
I have tried these solutions as well and they didn't work either:
https://stackoverflow.com/a/41399166/11983010
https://stackoverflow.com/a/35306665/11983010
If you have versioning enabled that won't be possible
You can delete a bucket that contains objects using the AWS CLI only if the bucket does not have versioning enabled. If your bucket does not have versioning enabled, you can use the rb (remove bucket) AWS CLI command with --force parameter to remove a non-empty bucket. This command deletes all objects first and then deletes the bucket.
Try disabling versioning.
Alternatively recursively delete all objects in the S3 bucket first by running the following
aws s3 rm s3://bucket-name --recursive

AWS S3 CLI with Transfer Acceleration Download command throws 400 error : when calling the HeadObject operation: Bad Request

I am trying to upload/download to S3 with transfer acceleration endpoint in AWS CLI from an EC2.
aws s3 cp /home/centos/<FOLDER_NAME> s3://<BUCKET_NAME>/<KEY_NAME> --region
ap-south-1 --endpoint-url http://<S3-Transfer-Acc-endpoint> [--recursive]
I am able to upload files and folders successfully and also the download using recursive for folders works.
But when i download a single large file from the bucket, using the following command
aws s3 cp s3://<BUCKET_NAME>/<KEY_NAME> /home/centos/<KEY_NAME> --region
ap-south-1 --endpoint-url http://<S3-Transfer-Acc-endpoint>
I face the below issue
fatal error: An error occurred (400) when calling the HeadObject operation:
Bad Request