Skip to content
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_management_lock #20923

Open
1 task done
svrviny1324 opened this issue Mar 14, 2023 · 1 comment
Open
1 task done

azurerm_management_lock #20923

svrviny1324 opened this issue Mar 14, 2023 · 1 comment

Comments

@svrviny1324
Copy link

svrviny1324 commented Mar 14, 2023

Screenshot 2023-03-14 at 00 43 40

### Is there an existing issue for this?
  • I have searched the existing issues

Community Note

  • 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

Terraform Version

3.18.0

AzureRM Provider Version

3.18.0

Affected Resource(s)/Data Source(s)

azurerm_management_lock

Terraform Configuration Files

resource "azurerm_management_lock" "container_delete_lock" {
  for_each = var.containers

  name          = "delete-lock-${each.key}"
  lock_level    = "CanNotDelete"
  notes         = "Prevent accidental deletion of container ${each.key}"
  scope         = azurerm_storage_container.container[each.key].id
}

Debug Output/Panic Output

Error: creating Scoped Lock (Scope: ""
│ Lock Name: "delete-lock-eu-devops-dev-scripts-temp"): managementlocks.ManagementLocksClient#CreateOrUpdateByScope: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="MissingSubscription" Message="The request did not have a subscription or a valid tenant level resource provider."
 with azurerm_management_lock.container_delete_lock["eu-devops-dev-scripts-temp"],
│   on main.tf line 91, in resource "azurerm_management_lock" "container_delete_lock":
│   91: resource "azurerm_management_lock" "container_delete_lock" {

Expected Behaviour

when i try to create lock for storage account level its working fine and we are unable to delete storage account , but when i try to delete container within same storage account it is providing an overide option to remove lock and delete container ,so then iam trying to create lock for container level but iam getting above error ,how i can reslove this issue?

Actual Behaviour

how to apply lock for container without providing override option when we try to delete container

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

@ghost
Copy link

ghost commented Jul 21, 2023

Possibly related: #1550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants