Skip to content

How to use mobiletargeting:SendOTPMessage and mobiletargeting:VerifyOTPMessage

0

When using the mobiletargeting:SendOTPMessage in the context of Amazon Pinpoint project, I receive an error such as the following.

User: arn:aws:iam::<snip>:user/<snip> is not authorized to perform: mobiletargeting:SendOTPMessage on resource: arn:aws:mobiletargeting:<region>:<accountId>:apps/<projectId>/otp

Adding the policy as below does not recognize mobiletargeting:SendOTPMessage or mobiletargeting:VerifyOTPMessage, What am I missing?

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogStream", "logs:PutLogEvents", "logs:CreateLogGroup" ], "Resource": "arn:aws:logs:::" }, { "Effect": "Allow", "Action": [ "mobiletargeting:SendOTPMessage", "mobiletargeting:VerifyOTPMessage " ], "Resource": "arn:arn:aws:mobiletargeting:<region>:<accountId>:apps/<projectId>/otp/" } ] }

asked 4 years ago1.1K views
1 Answer
0
Accepted Answer

After some help from AWS technical support, the issue was resolved by following the steps below.

  1. Create a policy as shown below. There are two key points;
    • Ignore the two "Invalid Action" errors related to SendOTPMessage and VerifyOTPMessage in the GUI. Save the policy
    • Ensure that the Resource URL is exactly as specified and uses your account id.

In other words, use this instead of the policy example in "Step 2.1: Create an IAM policy" at https://docs.aws.amazon.com/pinpoint/latest/developerguide/tutorials-two-way-sms-part-2.html

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "UseConsole",
            "Effect": "Allow",
            "Action": [
                "mobiletargeting:SendOTPMessage",
                "mobiletargeting:VerifyOTPMessage"
            ],
            "Resource": "arn:aws:mobiletargeting:*:YOUR_ACCOUNT_ID:apps/*"
        }
    ]
}
  1. Attach this policy to the user.
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.