jmoorhead
jmoorhead

Reputation: 403

I am trying to connect to AWS S3 after setting the bucket policy to force SSL

I am using a bucket policy to force SecureTransport:

{
    "Version": "2012-10-17",
     "Id": "S3SecureTransportPolicy",
     "Statement": [
     {
     "Sid": "ForceSSLOnlyAccess",
     "Effect": "Deny",
     "Principal": {
         "AWS": "*"
     },
     "Action": "s3:*",
     "Resource": "arn:aws:s3:::mybucket/*",
     "Condition": {
         "Bool": {
             "aws:SecureTransport": "false"
}}}]}

This works:

aws s3 ls

But this doesn't

aws --profile default s3 cp "New Text Document.txt" s3://s3-us-east-1.amazonaws.com/mybucket/dir/

Could someone tell me if I can still use the AWS CLI in Windows to upload files to S3 now that I am forcing SSL? If so, how?

My IAM account access / secret key has admin access. Using CloudBerry Explorer with the SSL checkbox checked works.

Thank you in advance!

Upvotes: 1

Views: 887

Answers (1)

John Hanley
John Hanley

Reputation: 81386

The problem is how you are specifying your bucket in the command line.

For the AWS CLI do not specify a URL such as s3://s3-us-east-1.amazonaws.com/mybucket/dir/ instead specify the bucket and path like this s3://mybucket/dir/

Upvotes: 3

Related Questions