Installation guide
A region parameter is also required and must be set to one of the following values: us-east-1,
ap-northeast-1, sa-east-1, ap-southeast-1, ap-southeast-2, us-west-2, us-gov-west-1,
us-west-1, cn-north-1, eu-west-1
use Aws\Sns\SnsClient;
$client = SnsClient::factory(array(
'key' => '<aws access key>',
'secret' => '<aws secret key>',
'region' => '<region name>'
));
You can provide your access keys like in the preceding example, or you can choose to omit them if you are using
AWS Identity and Access Management (IAM) roles for EC2 instances or credentials sourced from the
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.
Service builder
A more robust way to connect to Amazon Simple Notification Service is through the service builder. This allows you
to specify credentials and other configuration settings in a configuration file. These settings can then be shared
across all clients so that you only have to specify your settings once.
use Aws\Common\Aws;
// Create a service builder using a configuration file
$aws = Aws::factory('/path/to/my_config.json');
// Get the client from the builder by namespace
$client = $aws->get('Sns');
This guide is incomplete
This guide is not quite finished. If you are looking for a good way to contribute to the SDK and to the rest of the
AWS PHP community, then helping to write documentation is a great place to start. Our guides are written in
ReStructuredText and generated using Sphinx. Feel free to add some content to our documentation and send a
pull request to https://github.com/aws/aws-sdk-php. You can view our documentation sources at
https://github.com/aws/aws-sdk-php/tree/master/docs.
API Reference
Please see the Amazon Simple Notification Service Client API reference for a details about all of the available
methods, including descriptions of the inputs and outputs.
AddPermission ConfirmSubscription
CreatePlatformApplication CreatePlatformEndpoint
CreateTopic DeleteEndpoint
DeletePlatformApplication DeleteTopic
GetEndpointAttributes GetPlatformApplicationAttributes
GetSubscriptionAttributes GetTopicAttributes
ListEndpointsByPlatformApplication ListPlatformApplications
ListSubscriptions ListSubscriptionsByTopic
ListTopics Publish
Amazon Simple Notification Service
117