aws-samples / api-gateway-secure-pet-store

Amazon API Gateway sample using Amazon Cognito credentials through AWS Lambda
Apache License 2.0
308 stars 113 forks source link

Problem with Trust Policy file #27

Closed stand00d closed 7 years ago

stand00d commented 7 years ago

I am new to AWS, so, I may be doing this wrong. But, any help would be greatly appreciated.

I tried to create the Lambda Role by first creating two policies. One named TestAppTrust that contained the following:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }

When I attempt to validate the policy I get an error. Specifically, the error is:

This policy contains the following error: Has prohibited field Principal For more information about the IAM policy grammar, see AWS IAM Policies.

When I read the "policy grammar" everything looks correct and appropriate.

What am I doing wrong?

Thanks,

Stan

stand00d commented 7 years ago

So, I realized, you get this by default. So, you don't actually have to do anything except create the role.