Allow arbitrary named hook functions for Pre and Post Hook feature of Safe Deployments. #250
Open
Description
If you need to use the Pre or Post Hook feature of the Safe Deployments, you need to name the hook function with a prefix (CodeDeployHook_). This is not super clear and breaks the mental model customers have on naming CloudFormation resources.
Option 1:
To make this feature more flexible and allow customers to follow the naming schema's they wish, I am proposing to add a Policy Template. This would be mostly the same IAM Role CodeDeploy needs that takes the hook functions in as a parameter.
Option 2:
SAM could create the CodeDeploy IAM Role and inject the Lambda Function arns into the policy. In the DeploymentPreference
block, customers are already defining the functions for the pre and post hook.
Thoughts?