Closed
Description
Description:
I am writing a lambda function which is supposed to be triggered by CodeCommit. However, I cannot figure out how to add the permissions for CodeCommit. If I configure it via GUI (screenshot), it works without a problem.
I saw, that there has been discussions about that.
I do not see a reason, why we should use workarounds like SNS (I haven't even seen a full example for this), if there is direct support for CodeCommit Events.
Observed result:
CodeCommit has no permission to invoke Lambda.
Expected result:
SAM accepts something like the following in template.yaml
Resources:
CodePipelineTriggerFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: src/
Handler: app.lambda_handler
Runtime: python3.7
Tracing: "Active"
Policies:
- AWSCodePipelineFullAccess
Events:
CodeCommitTrigger:
Type: CodeCommit
Properties:
RepositoryName: back-end
TriggerName: back-end-trigger