Using protect configurations in AWS End User Messaging SMS - AWS End User Messaging SMS

Using protect configurations in AWS End User Messaging SMS

Use protect configurations to control which destination countries AWS End User Messaging SMS can send your messages to. By controlling which countries you allow messages to be sent to, you can avoid sending to countries with high message prices or countries you don't operate in. Each protect configuration contains individual allow and block country rules for SMS, MMS, and voice.

You can use a protect configurations as the account default, with a configuration set, or in the ProtectConfigurationId parameter of the SendMediaMessage, SendTextMessage, or SendVoiceMessage commands. When set as an account default, a protect configuration will also affect messages sent through Amazon SNS, Amazon Cognito and SendMessages.

The selection process for the effective protection configuration for a sending request is as follows:

  1. ProtectConfigurationId – If a protection configuration is specified in the API request parameters, it will be used.

  2. ConfigurationSetName – If no protection configuration is specified in the API request parameters, but a configuration set is specified and it has an associated protection configuration, then the protection configuration associated with this configuration set will be used.

  3. Account default – If a protection configuration is not specified or available from 1 or 2, the account default protection configuration will be used.

  4. None – If no account default is configured, then no protection configuration will be applied.

A protect configuration can be associated to multiple configuration sets, while a configuration set can only be associated with one protect configuration. There can only be one account default protect configuration at any time.

The following example for SendMediaMessage has both a configuration set and protect configuration specified in the command. The protect configuration specified in the ProtectConfigurationId parameter is used regardless of whether the configuration set has an associated protect configuration or if there is an account default protect configuration.

aws pinpoint-sms-voice-v2 --region 'us-east-1' send-media-message --destination-phone-number +12065550150 --origination-identity +14255550120 --message-body 'text body' --media-urls 's3://s3-bucket/media_file.jpg' --configuration-set-name ConfigSetName --protect-configuration-id ProtectConfigId

Depending on your use case we recommend the following: