terraform-azurerm-lz-vending icon indicating copy to clipboard operation
terraform-azurerm-lz-vending copied to clipboard

feat:Move and delete decomissioned subscriptions

Open knuterik-ballestad opened this issue 11 months ago • 2 comments

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

When we remove a subscription using terraform, it is simply moved to the tenant root. Isn't the management group "Decommisioned" in the ALZ mgmt-structure supposed to be the target location for such decomissioned subscriptions?

Describe the solution you'd like

I would like that the decomissioned subscriptions would be moved to the "Decommisioned"-folder after terraform removes them. It would also be nice with functionality to clean up/remove them altogether after the "grace period" has ended.

knuterik-ballestad avatar Mar 19 '24 14:03 knuterik-ballestad

Doesn't solve the above, but if you change the default management group to "Decommissioned" then all subscriptions removed from the config will get disabled and dropped there.

The caveat is that all newly create subscriptions also get placed there initially.

sturlabragason-devoteam avatar Apr 08 '24 10:04 sturlabragason-devoteam

Upon destroy, the AzureRM provider will cancel and move the sub to the default MG.

If you use the new AzAPI option you have more control but you must orchestrate this outside the module.

matt-FFFFFF avatar Apr 25 '24 12:04 matt-FFFFFF