Making Requests Using AWS Account or IAM User Credentials - AWS SDK for PHP
This topic guides you through using a class from the AWS SDK for PHP to send authenticated requests using your AWS account or IAM user credentials.
This topic assumes that you are already following the instructions for Using the AWS SDK for PHP and Running PHP Examples and have the AWS SDK for PHP properly installed.
Making Requests Using Your AWS Account or IAM user Credentials
Execute one of the
The following PHP code sample demonstrates the preceding tasks and illustrates how the client makes a request using your security credentials to list all the buckets for your account.
use Aws\S3\S3Client; // Instantiate the S3 client with your AWS credentials $s3 = S3Client::factory(); $result = $s3->listBuckets();
For an example of listing object keys in a bucket, see Listing Keys Using the AWS SDK for PHP.