Reputation: 69
The question is mostly self-explanatory.
If I run aws s3 cp <s3_bucket> <ec2_host>
locally (assuming both the bucket and the instance are on the same region), does the data go from s3 to ec2 internally (in which case there are no data transfer costs), or does it go first from the bucket to my computer, and only then to the instance (in which case there are s3 download data transfer costs)?
Thanks a lot.
Upvotes: 1
Views: 865
Reputation: 238867
AWS S3 pricing writes:
Transfers between S3 buckets or from Amazon S3 to any service(s) within the same AWS Region are free.
Please note that if you are using NAT gateway to access S3 from private subnet you will pay for NAT transfers. Use VPC S3 gateway endpoint instead. So if you are using aws s3 cp
from private subnet through NAT, you will pay for them.
Upvotes: 1
Reputation: 10832
The documentation for the cp
command states this at the beginning:
cp
<LocalPath> <S3Uri> or <S3Uri> <LocalPath> or <S3Uri> <S3Uri>
In other words, each of the x
and y
in aws s3 cp <x> <y>
can be either a S3 URI or a local reference. There is no option there to point it at an EC2 instance. If you did try to run aws s3 cp s3://bucketname/key.name 1.2.3.4
, you would just end up with a file called 1.2.3.4
on your machine.
Upvotes: 0