Appendix A: Add Permission Using JSON to the Processing Method AWS Lambda Function - Amazon Personalize Optimizer Using Amazon Pinpoint Events

Appendix A: Add Permission Using JSON to the Processing Method AWS Lambda Function

You can use JSON to add permission to the role that runs the Processing Method AWS Lambda function by taking the following steps.

  1. Scroll to the Execution role section and, under Existing role, choose the View the <function-name> role on the IAM console text link. The IAM console opens in a new browser tab.

  2. On the Summary page, choose Attach policies.

  3. On the Add permissions page, choose Create policy. The Create policy page opens in a new browser tab.

  4. In the JSON tab, enter the following code snippet.

    { "Version": "2012-10-17", "Statement": [ { "Sid": "EmitCustomEvents", "Effect": "Allow", "Action": "mobiletargeting:PutEvents", "Resource": "*" } ] }
  5. Choose Review policy.

  6. In the Name field, enter a <policy-name> and, optionally, enter a Description.

    Note

    For the <policy-name>, create a name for this role that is meaningful to you, for example, EmitCustomEventsPolicy.

  7. Choose Create policy.

  8. Return to the Add permissions page, choose the refresh button to ensure that your newly created policy is added to the list, and search for that policy.

  9. Select your policy and choose Attach policy.

You return to the IAM policy page and receive a confirmation that the policy was attached.