I want to transfer data from an EC2 machine in one account to an S3 bucket on another account. Here, both the services are in the same region. Is the transfer of data happening over the internet as both are on different accounts?
There is no charge for Data Transfer between Amazon EC2 and Amazon S3 in the same region. This includes situations where information is being transferred between AWS Accounts.
From Amazon S3 Simple Storage Service Pricing - Amazon Web Services:
You pay for all bandwidth into and out of Amazon S3, except for ... Data transferred out to an Amazon Elastic Compute Cloud (Amazon EC2) instance, when the instance is in the same AWS Region as the S3 bucket (including to a different account in the same AWS region).
I know the wording is confusing, but basically traffic between EC2 and S3 in the same region is not charged.
Yes, the data transfer is happening over the internet if ec2 and s3 are in different regions ( irrespectivie of same account or different account ) .
But for ec2 and s3 in same region you can use VPC Endpoint specific to S3 to route the data internal to AWS .
For more clarity, use tcpdump to capture the packets specific to s3 or take a tcpdump on port 53 ( dns ) you should get an s3 endpoint URL for s3 which ec2 is using to access s3.like this :
12:05:40.479211 IP ip-10-80-0-2.eu-central-1.compute.internal.domain > ip-172-18-0-12.eu-central-1.compute.internal.34545: 21349 2/0/0 CNAME s3-r-w.eu-central-1.amazonaws.com., A 52.219.72.229 (124)
12:05:40.479213 IP ip-10-80-0-2.eu-central-1.compute.internal.domain > ip-172-18-0-12.eu-central-1.compute.internal.34545: 21349 2/0/0 CNAME s3-r-w.eu-central-1.amazonaws.com., A 52.219.72
You can know if it's resolving to Public IP or Private IP
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With