title: AWS Sagemaker + AWS Lambda
body: <p>I try to use AWS SageMaker following documentation. I successfully loaded data, trained and deployed the model.</p>
  <p><a href="https://i.stack.imgur.com/4Mjew.png" rel="nofollow noreferrer">deployed-model</a></p>
  <p>My next step have to be using AWS Lambda, connect it to this SageMaker endpoint.
  I saw, that I need to give Lambda IAM execution role permission to invoke a model endpoint.
  I add some data to IAM policy JSON and now it has this view</p>
  <pre><code>{
  &quot;Version&quot;: &quot;2012-10-17&quot;,
  &quot;Statement&quot;: [
      {
          &quot;Effect&quot;: &quot;Allow&quot;,
          &quot;Action&quot;: &quot;logs:CreateLogGroup&quot;,
          &quot;Resource&quot;: &quot;arn:aws:logs:us-east-1:&lt;my-account&gt;:*&quot;
      },
      {
          &quot;Effect&quot;: &quot;Allow&quot;,
          &quot;Action&quot;: [
              &quot;logs:CreateLogStream&quot;,
              &quot;logs:PutLogEvents&quot;
          ],
          &quot;Resource&quot;: [
              &quot;arn:aws:logs:us-east-1:&lt;my-account&gt;:log-group:/aws/lambda/test-sagemaker:*&quot;
          ]
      },
      {
          &quot;Effect&quot;: &quot;Allow&quot;,
          &quot;Action&quot;: &quot;sagemaker:InvokeEndpoint&quot;,
          &quot;Resource&quot;: &quot;*&quot;
      }
  ]
  </code></pre>
  <p>}</p>
  <p>Problem that even with role that have permission for invoking SageMaker endpoint my Lambda function didn't see it</p>
  <pre><code>An error occurred (ValidationError) when calling the InvokeEndpoint operation: Endpoint xgboost-2020-10-02-12-15-36-097 of account &lt;my-account&gt; not found.: ValidationError
  </code></pre>