Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ugultopu/8177d2904a9c9746c3f97aea65e15964 to your computer and use it in GitHub Desktop.
Save ugultopu/8177d2904a9c9746c3f97aea65e15964 to your computer and use it in GitHub Desktop.

Most likely, the AWS user that is associated with the app does not have API execution permissions. To fix this, perform the following steps. If you already have an AWS user, you can skip the first two steps. Note that the steps here are not necessarily the "best practices" as suggested by Amazon. Nevertheless, they are the most straightforward ones and shouldn't cause any problems:

  • Create an (any) AWS account. Note that the AWS account does not necessarily need to have any relation whatsoever with the account that you used to create your Amazon Marketplace.

  • Go to AWS Identity and Access Management Console (IAM) and create a user without any group memberships or attached policies whatsoever. Give a name of your choosing to the user.

  • Select the user that you've just created and expand the "Add permissions" dropdown menu and select "Add inline policy". On the editor that's just been launched, select JSON and replace its contents with the following:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": "execute-api:Invoke",
                "Resource": "arn:aws:execute-api:*:*:*"
            }
        ]
    }

    Then, click on "Review policy" and give a name of your choosing to the policy. "API" or "Execute API" would be some of the suitable ones. Finally, click on "Create policy". This will create a policy that gives this user permissions to execute various Amazon APIs.

  • And we're done! Note that it might take some time (sometimes even up to 10 minutes) for the permissions to take effect, so don't panic if the unauthorized error with no details does not immediately go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment