ExAws v1.0.0-beta0 ExAws.SNS
Defines an SNS Client
By default you can use ExAws.SNS
Usage
defmodule MyApp.SNS do
use ExAws.SNS.Client, otp_app: :my_otp_app
end
In your config:
config :my_otp_app, :ex_aws,
sns: [], # SNS config goes here
You can now use MyApp.SNS as the root module for the SNS API without needing to pass in a particular configuration. This enables different OTP apps to configure their AWS configurations separately.
The alignment with a particular OTP app while convenient is however entirely optional.
The following also works:
defmodule MyApp.SNS do
use ExAws.SNS.Client
def config_root do
Application.get_all_env(:my_aws_config_root)
end
end
ExAws now expects the config for that client to live under :my_aws_config_root:
config :my_aws_config_root
sns: [] # SNS config goes here
Default config values can be found in ExAws.Config.
General notes
TODO
Examples
TODO
http://docs.aws.amazon.com/sns/latest/APIReference/API_Operations.html
Summary
Functions
Create topic
Delete topic
Get topic attributes
List topics
Publish message to a target/topic ARN
Set topic attributes
Types
message_attribute :: %{name: binary, data_type: :string | :number | :binary, value: {:string, binary} | {:binary, binary}}
publish_opts :: [message_attributes: [message_attribute], message_structure: :json, subject: binary, target_arn: binary, topic_arn: binary]
topic_arn :: binary
topic_attribute_name ::
:policy |
:display_name |
:delivery_policy
topic_name :: binary
Functions
Specs
create_topic(topic_name :: topic_name) :: ExAws.Operation.Query.t
Create topic
Specs
delete_topic(topic_arn :: topic_arn) :: ExAws.Operation.Query.t
Delete topic
Specs
get_topic_attributes(topic_arn :: topic_arn) :: ExAws.Operation.Query.t
Get topic attributes
Specs
list_topics(opts :: [{:next_token, binary}]) :: ExAws.Operation.Query.t
List topics
Specs
publish(message :: binary, opts :: publish_opts) :: ExAws.Operation.Query.t
Publish message to a target/topic ARN
You must set either :target_arn or :topic_arn but not both via the options argument.
Do NOT assume that because your message is a JSON blob that you should set message_structure: to :json. This has a very specific meaning, please see http://docs.aws.amazon.com/sns/latest/api/API_Publish.html for details.
Specs
set_topic_attributes(attribute_name :: topic_attribute_name, attribute_value :: binary, topic_arn :: topic_arn) :: ExAws.Operation.Query.t
Set topic attributes