Description:
Invalid resource for policy template: CodePipelineLambdaExecutionPolicy
The codepipeline:PutJobSuccessResult and codepipeline:PutJobFailureResult actions require * for the resource in an IAM policy statement. The statement in the policy_templates.json is invalid:
Steps to reproduce the issue:
CodePipelineLambdaExecutionPolicy: {}Observed result:
Pipeline times out waiting for acknowledgement from lambda function because lambda function gets access denied error:
Aws::CodePipeline::Errors::AccessDeniedException: User: arn:aws:sts::0000000000:assumed-role/aws-serverless-repository-cfn/foo is not authorized to perform: codepipeline:PutJobFailureResult
Expected result:
Lambda should be able to acknowledge the pipeline.
@sanathkr Any thoughts on this one? Would love to hear it is just me doing something wrong 馃槅
miss on our part. From their documentation: "You specify the actions in the policy's Action field, and you specify a wildcard character (*) as the resource value in the policy's Resource field. ". Fixing. Should update the issue on release. Apologies for the miss.
CodePipeline policy template was a nice addition. I can publish my app into Serverless Application Repository (only allows sam policy templates ) without having to add the IAM policy manually after deploying the app.
@salmanap don't forget us! 馃檪I really don't mind fixing it by editing the IAM policy for my own use. It would be nice to have it fixed for apps published into AWS Application Repository to have it "plug & play" for other users.
Here is AWS policy editor complaining about the invalid Resources config in the policy.
Thanks!

@Tanbouz thanks for pinging. Do you want to submit a PR for this? It's simple to do via the GitHub UI (especially for Policy Template changes). I'll walk you through the steps:
"CodePipelineLambdaExecutionPolicy" entry on line 824"Resource" entry on line 837 with "Resource": "*"This will be fixed in our next release. Closing. Thanks again @Tanbouz