Azure / deployment-stacks

Contains Deployment Stacks CLI scripts and releases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting ActionOnUnmanage for DeploymentStacks

azcloudfarmer opened this issue · comments

Is your feature request related to a problem? Please describe.
This issue aims to explore alternative ways of setting actionOnUnmanage for a Deployment Stack resource.

Describe alternatives you've considered
We are looking to get feedback on the experience of setting actionOnUnmanage with the existing method and also get feedback on a potential alternative. Today, the actionOnUnmanage property of a deployment stack can be set by using one of the following delete flags:

1. --delete-resources
2. --delete-all
3. no flag

Each of these flags would result in the following actionOnUnmanage states:

  1. --delete-resources:
"actionOnUnmanage": {
    "managementGroups": "detach",
    "resourceGroups": "detach",
    "resources": "delete"
},
  1. --delete-all:
"actionOnUnmanage": {
    "managementGroups": "delete",
    "resourceGroups": "delete",
    "resources": "delete"
},
  1. no flag (if no delete flag is specified, the resulting actionOnUnmanage state defaults to):
"actionOnUnmanage": {
    "managementGroups": "detach",
    "resourceGroups": "detach",
    "resources": "detach"
},

The following alternative aims to make these states more explicit in our stack commands. First lets consider the following example deployment stack commands with new parameter flag for actionOnUnmange and their resulting states (equivalent to the corresponding states listed above):

  1. --actionOnUnmange DeleteResources
"actionOnUnmanage": {
    "managementGroups": "detach",
    "resourceGroups": "detach",
    "resources": "delete"
},
  1. --actionOnUnmanage DeleteAll:
"actionOnUnmanage": {
    "managementGroups": "delete",
    "resourceGroups": "delete",
    "resources": "delete"
},
  1. --actionOnUnmanage DetachAll:
"actionOnUnmanage": {
    "managementGroups": "detach",
    "resourceGroups": "detach",
    "resources": "detach"
},