简体   繁体   中英

How do I access my S3 With my EC2 instance on aws

I have an web application where i want to put my static content on s3 bucket. I need to access my s3 content with my Ec2 Instance. S3 bucket may contain image, songs and videos. I need to show all the content of S3 buckets on websites.

If you want to access it by ssh-ing into the EC2 instance, you can use the aws s3 cli or s3cmd .

If you want to include S3 content in a website and make it publicly visible, note that you can access your S3 files using HTTP ( see here for instructions ):

https://s3.amazonaws.com/bucket/filepath/filename

您可以使用适用于PHP的AWS开发工具包来管理您的S3 ... PHP S3 SDK

http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-s3.html

If you want to interact with S3 directly from your PHP code, you are probably looking the sdk for PHP provided by aws.

This SDK permits you to directly interact with AWS components. The documentation for S3 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM