2

I have an EC2 instance in public subnet with default NACL and try to connect to S3 bucket through internet. My EC2 has a IAM role that allows access to this S3 bucket. S3 bucket has no bucket policies.

I want to connect to this S3 through HTTP, not HTTPS (for testing purposes). To do that, I changed outbound rule for security group to accept only 80 port.

When I try to access this S3, the request gets stuck.

When I change outbound rule for security group to accept only 443 port, the connection works.

enter image description here

Anyone knows why port 80 is not working ? How can I access S3 bucket through HTTP?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
jtcnw
  • 81
  • 1
  • 4
  • You probably need to tell the cli to use http instead of https, maybe by specifying a different endpoint. – luk2302 Mar 30 '22 at 19:13

1 Answers1

3

If I understand your question, you'll want something like:

aws --endpoint-url http://s3.us-west-1.amazonaws.com s3 ls s3://your-bucket

Where the endpoint URL comes from the Amazon S3 endpoints on this page. All AWS cli commands default to HTTPS. You must specify the endpoint to switch to HTTP.

stdunbar
  • 16,263
  • 11
  • 31
  • 53