I changed the Authorization Type for API to AWS_IAM, then I created an user with the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"execute-api:Invoke"
],
"Resource": [
"arn:aws:execute-api:us-east-1:account_id:api-id/stage/GET/*"
]
}
]
}
And tried to access this API through postman, and it worked. But when I'm giving this user's access_key_id and secret_access_key to an EC2 instance through aws configure
and then trying to access the API (curl URL
), its giving me Missing Authentication token
.
Any help is appreciated. Thank You.