aws / aws/serverless-application-model

Allow arbitrary named hook functions for Pre and Post Hook feature of Safe Deployments.

Open
#250 6 comments 3 reactions 0 assignees View on GitHub
area/policy-templates area/safe-deployments stage/needs-feedback stage/pm-review type/design type/feature
Dominant language
Python
Stars
9.6k
Forks
2.5k
Avg merge
1d 11h
Merged PRs (30d)
7

Description

If you need to use the Pre or Post Hook feature of the [Safe Deployments](https://github.com/awslabs/serverless-application-model/blob/master/docs/safe_lambda_deployments.rst#pretraffic-posttraffic-hooks), 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](https://github.com/awslabs/serverless-application-model/blob/master/docs/policy_templates.rst). 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.