Azure / Azure/deployment-stacks

Granular control for resource action on unmanage

Open
#216 0 comments 2 reactions 0 assignees View on GitHub
feature request needs upvote
Dominant language
Bicep
Stars
101
Forks
13
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
By default and in most cases, I'm running stacks with DeleteAllResources aou and the deployment runs from pipeline. However, some resources I would like to be left not deleted (databases, storage containers, etc) even if it's not part of the deployment.
Since deployments runs from a pipeline and sometimes changes are applied in bulk (i.e. when applying template tested on stage to a higher env), I'm not able to control each step and template modification

**Describe the solution you'd like**
I would like to add a decorator on a resource in bicep so that next time the stack deployment runs without marked resource, the resource will not be deleted, but detached.

Also, I would like to have a decorator that would keep the resource in stack even though it's not being deployed - with bicep's `onlyIfNotExists` decorator (now experimental), this could lead to resource removal on second deployment. Or we might have some conditional resources and not always not deploying them in template means that we want to delete them.

**Additional context**
In terraform and in pulumi there are options to mark resource to be preserved after removing it from iac/state file.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.