Re:I made a mistake with Terraform and Azure made it worse
by vimwizard on Friday July 09, 2021 @01:33AM
(#27780735)
What happened is OP imported an AzureRM resource group into a terraform resource, then "deleted" the resource by changing to a data block. When you delete a resource group in AzureRM it deletes every resource under it. This behavior is pretty stupid when mixed with terraform but as a rule of thumb if I'm not importing every resource under a resource group into the state then I make it a data call from the start. The missing step was to `terraform state rm <addr>` on the resource group and then change it to a data block.
[ Parent
| on HN ]
Re:I made a mistake with Terraform and Azure made it worse
by takeda on Friday July 09, 2021 @02:18AM
(#27780939)
Sounds to me like a bug in azure provider. It's job supposed to be understanding the environment and knowing what will happen for any given action.
Re:I made a mistake with Terraform and Azure made it worse
by mattbnr32 on Friday July 09, 2021 @01:16PM
(#27786016)
AFAIK terraform doesn't have a way to inject user interaction on provider-level operations.
Anyone know if az cli or powershell module prompts users before it deletes a resource group?