Does using a ProxyPass on a ec2 instance toward S3 bucket can cause a problem?

,

I need to use a proxypass (in Ubuntu) to get video on a s3 bucket.

Does the bandwidth get charge on the both s3 and ec2? Do I lose an advantage of s3 by doing this.

I am doing this to avoid the dreaded ‘SECURITY_ERR: DOM Exception 18’ in HTML5.


Related discussions:

You won’t get charged for bandwidth to S3, but you’ll still get charged for API calls. Consider running Cloudfront in front of S3 with an appropriate CNAME instead.

Also consider that S3’s ip address can change and many tools don’t re-resolve the IP address during runtime.

Be very sure you have an S3 endpoint set up in your VPC, otherwise you’ll be connecting to S3 over the internet.

S3 uri can change? Did not know that.

My plan b was Cloudfront, but i have not set it up in a while.

Thx for the reply.

Well the IP can change, and tools like varnish / haproxy (and probably nginx) do a one-time resolution and hold on to it. Then your app fails when the IP changes.

HAProxy and Nginx can each do run time resolving. HAProxy gained this ability in 1.6 and requires certain params on the server line. Nginx will do it if you use params in the proxy_pass.

http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass
http://blog.haproxy.com/2015/10/14/whats-new-in-haproxy-1-6/

Do they charge extra for an s3 endpoint in vpc?

Kind of. As long as you’re in the same region the traffic stays within the AWS network even though you’re using publicly reputable IPs. The real advantage of an S3 endpoint is that you can access the service from private subnets. In this case the instance will need a route to an IGW anyway so there’s not really any benefit.

No and it’s far more predictable in its speed

There is more predictable speed with the endpoint. It’s not faster or slower in a significant way, just more predictable.

Valid. I guess where I was struggling was in a semi-private subnet, where instances were accessing the internet through a NAT instance, and when there as a ton of S3 activity, it would get totally crushed.

Cool thanks! Is there any reason not to then?

I’ve had trouble getting the HAProxy mode to work properly, but assuming thats something else wrong with my environment I just want to raise awareness of the IP changing behavior (and DNS permacaching) and make sure people check their tools work properly against it.

Not really except you don’t see level 7 visibility if you need to see it