aws-samples / aws-samples/sample-iac-cloudformation-wrapper

Make `CodeBuildTriggerFunction.BuildOnDelete` the default?

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Today, the standard `CodeBuildTriggerFunction` custom resource re-runs CodeBuild on stack `UPDATE` events by default (unless an `IgnoreUpdate` property is set explicitly), but ignores `DELETE` events (unless a `BuildOnDelete: true` property is set explicitly). However, our examples all deliberately handle delete/destroy in the CodeBuild scripts and so override this default (so that deleting the bootstrap CloudFormation stack also de-provisions the CDK/Terraform resources).

From a consistency and ease-of-use perspective, it seems more natural to switch `BuildOnDelete`->`IgnoreDelete`, and have the resource run a build on all events by default unless overridden.

In Terraform in particular, preserving solution resources on bootstrap CloudFormation delete requires additional changes anyway (since the Terraform state tracking bucket should not be emptied or deleted) - so it'd make more sense to have all resources aligned toward a single pattern by default.

Open to feedback if folks see problems with this proposed change though!

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.