Closed harryherbig closed 4 years ago
Okay may have found the problem:
The FunctionName attribute explicitly tells CloudFormation what to name the function. Otherwise, CloudFormation creates the function with the default naming convention: [stackName]-[FunctionName]-[uniqueID]. Name the function with the “CodeDeployHook_” prefix because the CodeDeployServiceRole role only allows InvokeFunction on functions named with that prefix.
mentioned here: https://aws.amazon.com/blogs/compute/implementing-safe-aws-lambda-deployments-with-aws-codedeploy/
Yep, that solved the issue, so I close it.
A complete example which tackles all the obstacles in one repo would be helpful. I still don't know what kind of Event the pre-traffic-hook lambda will get as an Input, so I am using String for now, and the examples I found are using untyped javascript.
While evaluating aws sam as a CD solution for lambda functions I had struggles finding appropriate guides or documentation, and had to combine random examples and guides to get my "safe deployment" pipeline working.
I managed to setup everything after consulting different github repos and guides, but the CodeDeploy Deployment fails with this message:
The implicitly generated IAM Role looks like this:
this is my template.yaml: