I'm new to AWS S3, and I'm studying S3 SDK now.
If I would like to put a file on S3, there are two ways:
1) Using SDK client, $s3->putObject method
2) Using s3:// protocol
What's the difference between two?
Thank you! :)
Accessing AWS services via an SDK will make fully-authenticated API calls. Such calls require IAM credentials. They are the best way to interact with AWS services. Some commands, such as creating buckets, are only available via API calls.
Amazon S3 has the additional ability to provide access to objects via normal HTTP/HTTPS requests. For example, if an object is public, it can be accessed via https://s3.amazonaws.com/bucket-name/path/object
This means that content from Amazon S3 can be incorporated into web pages via <a>
and <img>
tags.
If you wish to use such links to access private objects, then the URL will need additional authentication information attached. This is know an a Amazon S3 pre-signed URL.