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}
答案 0 :(得分:3)
是的应该是安全的。
如果这确实发生了变化,那么它会破坏...... AWS服务名称,区域,域不太可能更改。 URL的其他部分由您控制。
答案 1 :(得分:0)
添加 - 您可以通过两种方式添加
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>
细节阅读:
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html