Add allowed_deletion
Config Option to resourceHerokuApp
#391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
allowed_deletion
Config Option toresourceHerokuApp
Description
This PR introduces a new configuration option,
allowed_deletion
, to theresourceHerokuApp
resource in theterraform-provider-heroku
. By default, this option blocks any actions that require deletion of a Heroku app, unless explicitly allowed by the user. This change is not backward-compatible, as all delete operations will now be blocked by default unlessallowed_deletion
is explicitly set totrue
.Changes
allowed_deletion
Option:bool
false
false
(default), any action requiring the deletion of a Heroku app (e.g.,terraform destroy
orterraform apply
with adelete
operation) will fail with a clear error message.true
, deletion actions are allowed, restoring the previous behavior.Behavior Changes:
allowed_deletion
is not explicitly set, deletion actions will now fail.allowed_deletion = true
to permit deletions.Documentation Updates:
resource_heroku_app
documentation has been updated to detail theallowed_deletion
option, its purpose, and provide examples for enabling deletion.Tests:
allowed_deletion
in scenarios with and without deletion actions.Why is this change necessary?
Accidental deletion of Heroku apps can lead to data loss and service outages. This change introduces a safer default configuration that requires explicit user action to allow deletions, reducing the risk of unintended consequences.
Example Usage