- Newest
- Most votes
- Most comments
The error you're encountering indicates that your Lambda function doesn't have the proper permissions to execute the SendTextMessage operation, despite the policy you've attached.
There are a few things to check:
-
Make sure the IAM role attached to your Lambda function includes the policy you've shared. The error suggests that the assumed role "dow-lambda-dev/j25-cc-connect-lambda-neo_sms_dow_change-dev" doesn't have the necessary permissions.
-
Verify that the policy is correctly attached to the Lambda execution role, not just created but not associated.
-
The policy prefix for AWS End User Messaging SMS actions is "sms-voice", which you've correctly used in your policy.
-
Check that the resources in your policy match the actual resources you're trying to use. Your policy allows access to phone numbers and configuration sets in the eu-west-2 region for account 123456789.
-
If you're using a specific origination identity (like a sender ID) rather than just a phone number, you might need to include that resource in your policy as well.
If you've verified all these points and are still experiencing issues, you might need to broaden the policy temporarily for testing (using "*" for the resource) to determine if there's another resource that needs permission.
Sources
SendTextMessage - AWS End User Messaging SMS
How AWS End User Messaging SMS works with IAM - AWS End User Messaging SMS
Working with shared resources in AWS End User Messaging SMS - AWS End User Messaging SMS
answered a year ago
I haven't tested it myself but I believe the Resource property is incorrect as it expects complete ARNs. You can use either the specific configuration set and phone number (see Resource types) or a wildcard. Something like:
"Resource": [
"arn:aws:sms-voice:${Region}:${Account}:phone-number/*",
"arn:aws:sms-voice:${Region}:${Account}:configuration-set/*"
]
answered a year ago
Relevant content
- AWS OFFICIALUpdated 10 months ago
