Add Permissions to a Lambda Function

Issues

  • How do I create and add an IAM Role to a Lambda Function?
  • I don’t know what permissions I should add to my Lambda Function so that it’s able to invoke a SageMaker endpoint.
  • My Lambda Function fails to invoke the SageMaker Endpoint with a PermissionDenied exception.

Resolution

Your Lambda Function needs the correct permissions in order to be able to invoke a SageMaker Endpoint.

  • Log to the Lambda Console and select Functions from the menu on the left
  • Select your Function from the function list lambda console
  • Scroll down to Execution Role and tap on the highlighted link select function
  • Tap on Attach Policy execution role
  • In the Policy filter text box type SageMaker; select AmazonSageMakerFullAccess then tap on Attach policy attach policy