Reputation: 4122
I am using Amazon S3 to store images for my web app and iOS app.
I wonder if I can safely hardcode my bucket URL when fetching the images? So that I don't have to make one more API call just to fetch my URL.
For example, hardcoding this in my apps code:
https://s3.eu-central-1.amazonaws.com/mybucket/images/{some_var}
Upvotes: 6
Views: 1228
Reputation: 10917
Just to add - you can do it in two ways
http://bucket-name.s3.amazonaws.com/<file-name>
http://bucket-name.s3-aws-region.amazonaws.com/<file-name>
http://region-name.amazonaws.com/bucket-name/<file-name>
Detail Read:
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html
Upvotes: 0
Reputation: 450
Yes should be safe.
If this did change then it would break.. so much. AWS service name, region, domain are unlikely to change. The other parts of the URL are under your control.
Upvotes: 3