2 Answers
- Newest
- Most votes
- Most comments
1
Hi, Please follow the detailed steps below::
1. Source Account Setup (Account owning the phone number)
# Verify phone number sharing status aws pinpoint-sms-voice-v2 describe-phone-numbers --phone-number-id your-phone-id # Enable sharing for the phone number aws pinpoint-sms-voice-v2 update-phone-number \ --phone-number-id your-phone-id \ --sharing-status SHARED # Add resource policy aws pinpoint-sms-voice-v2 put-resource-policy \ --resource-arn "arn:aws:sms-voice:region:source-account:phone-number/phone-id" \ --policy '{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::destination-account:root" }, "Action": [ "sms-voice:SendTextMessage", "sms-voice:DescribePhoneNumbers" ], "Resource": "arn:aws:sms-voice:region:source-account:phone-number/phone-id" }] }'
2. Destination Account Setup
# Verify shared phone number is visible aws pinpoint-sms-voice-v2 describe-phone-numbers --owner SHARED # Create origination pool aws pinpoint-sms-voice-v2 create-pool \ --origination-identity "arn:aws:sms-voice:region:source-account:phone-number/phone-id" \ --iso-country-code US \ --message-type TRANSACTIONAL # Configure SNS to use the pool aws sns set-sms-attributes \ --attributes "DefaultSMSType=Transactional,DefaultSenderID=your-pool-id" # Test message sending aws sns publish \ --phone-number "+1234567890" \ --message "Test message"
3. For Cognito Integration
# Update Cognito SMS configuration aws cognito-idp update-user-pool \ --user-pool-id your-pool-id \ --sms-configuration '{ "SnsCallerArn": "arn:aws:iam::account-id:role/your-sns-role", "ExternalId": "your-external-id" }'
For more details:
0
Hi,
First, check if the phone number can be shared. Then, enable sharing for that number. Finally, set up a resource policy to allow the destination account to use the phone number for sending text messages and viewing its details.
Setting up the Destination Account
Start by confirming that the shared phone number is visible. Next, create a pool for originating messages using the shared number. Then, configure SNS to use this pool. Lastly, test sending a message.
Integrating with Cognito
Update the Cognito user pool's SMS configuration with the appropriate SNS role and external ID.
Relevant content
- asked 2 years ago
