updated the lambda permission with the correct case#1319
updated the lambda permission with the correct case#1319keetonian merged 6 commits intoaws:developfrom tomellis91:lambdapermissions
Conversation
|
Hi @ShreyaGangishetty , Is there anything else that you need from my end? I will be happy to help where possible. Cheers, |
|
@tde908 I will check and resolve these merge conflicts. Thank you for submitting this PR |
Codecov Report
@@ Coverage Diff @@
## develop #1319 +/- ##
========================================
Coverage 94.48% 94.48%
========================================
Files 78 78
Lines 4388 4388
Branches 871 871
========================================
Hits 4146 4146
Misses 116 116
Partials 126 126
Continue to review full report at Codecov.
|
ShreyaGangishetty
left a comment
There was a problem hiding this comment.
@tde908 I have resolved the merge conflicts and rebased. This PR looks good to me.
Issue #, if available:
The default policy action that get's added to the function permissions is in the incorrect case. It is being inserted as lambda:invokeFunction instead of lambda:InvokeFunction (note the i).
This means the permissions don't work as expected.
The correct case can be seen in the documentation here:
https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html
When triggering the function via API gateway as a GET request the response returns as:
Unable to determine service/operation name to be authorizedThis occurred when creating a CFN resource with Type: AWS::Serverless::Function
Description of changes:
I have updated the lambda action so that it is in the correct case: lambda:InvokeFunction
When creating the lambda the default policy is being added as:
"Principal": {
"Service": "apigateway.amazonaws.com"
},
"Action": "lambda:invokeFunction",
I have not updated the tests as of yet as there are a large number of files with the lowercase character. If you are happy with the change, please add a comment and I can go and update the remaining files before the change is merged.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.