-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't retrieve lambda policy for function created by SAM #307
Comments
#449 should fix this. Please let me know if this is still a problem. |
This appears to still be a problem. Lambda function created by SAM with no AWS::Lambda::Permission resource in the template - try to perform get_policy on the function and it fails. |
@haggaret We're not able to reproduce the issue you're describing. Can you provide a template that reproduces the issue you're seeing? |
Ran into this issue. I was able to get the policy for a function in us-east-1 but not in us-west-2 |
Found my issue: I was using an alias but was running |
Thanks for opening this issue! As this issue is very old, we are closing it due to inactivity. If you are still running into this issue, please re-open this issue and if possible add any additional information that would help us understand the problem you are encountering. |
Funny enough I forgot about this problem (and apparently didn't see the request for more information) but I just ran into it again. After opening a support case with AWS about this, they pointed me to this bug and asked that I add the AWS::Lambda::Permission resource to my template to fix it. For completeness, here is the template that I'm using:
I just use sam build and sam deploy to deploy it. I'll try adding the AWS::Lambda::Permission resource mentioned above - that must have been what I did previously. 🙂 |
Hi,
I have a simple Lambda function connected to API Gateway, similar to the swagger cors example.
I'm running into a similar issue as in #59 , so I'm trying to debug what is the problem with the
AWS::Lambda::Permission
.However, when I run
aws lambda get-policy --function-name <function-created-by-sam>
, I get this response:Querying any of my other Lambda functions, I get the expected policy in return. Not being able to query the policy makes this difficult to debug.
I do have the usual 2 permissions associated with the lambda function:
Using the same workaround as suggested in #59, I manage to get a hint to the nature of the problem. I added my own
AWS::Lambda::Permission
resource to the SAM template as follows:Now all of a sudden running
get-policy
gives me a response, and I am also able to successfully invoke the API. Seems like there is a problem with theAWS::Lambda::Permission
s that are setup by SAM, and the only way to fix it is to create a third Permission.For reference, here is what my template looks like:
The text was updated successfully, but these errors were encountered: