-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_subscription: prevent cancellation of existing subscriptions on destroy #15751
Comments
Hi @josh-barker, thanks for raising this and for the proposed PR. I agree that it might be useful to have the option of different behavior here, however in of itself this is not considered a bug. Resources imported into your Terraform state are treated exactly the same as resources which were created by Terraform in the first place. There is objectively no way to tell the difference between a once-imported resource and one that was never imported, and subjectively no reason to do so, since managing infrastructure with Terraform implies the same workflow regardless. I have commented in more detail on your PR #15752, however if you'd like to propose such a behavioral change you are welcome to open a new feature request in that vein for discussion. Accordingly, since this is expected behavior, I"m going to close this issue for now but as mentioned please feel free to write a feature request. Thanks! |
Hey @manicminer, thanks for reviewing and responding to the issue & PR. I originally raised this a while ago in the Slack channel, discussed with Tom Harvey and he suggested making a new resource. I find the current implementation of the
In scenarios 1 and 2, I would expect like all other resources that Terraform will create, update and delete the resource. However, scenario 3 is unusual. I like your idea of using a provider flag to disable subscription cancellations. How does the below definition proposal look? provider "azurerm" {
features {
subscription {
prevent_cancel_subscription = true # defaults to false
# or
prevent_cancel_existing_subscription = true # defaults to false
}
}
} Cheers |
Hi @josh-barker, that schema proposal looks pretty good to me. I'd probably suggest calling the property |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_subscription
Terraform Configuration Files
Expected Behaviour
As the subscription was not imported, I expect that the subscription should not have been cancelled.
Actual Behaviour
The subscription was cancelled.
Steps to Reproduce
terraform apply
terraform destroy
References
The text was updated successfully, but these errors were encountered: