Answers for "Create resource via terraform but do not recreate if manually deleted?"

0

Create resource via terraform but do not recreate if manually deleted?

variable "bootstrap" {
  type        = bool
  default     = false
  description = "Do not use this directly. Only for use by the bootstrap script."
}

resource "azurerm_storage_blob" "test" {
  count = var.bootstrap ? 1 : 0

  name                   = "myfile.txt"
  storage_account_name   = azurerm_storage_account.deployment.name
  storage_container_name = azurerm_storage_container.deployment.name
  type                   = "Block"
  source_content         = "test"
}
Posted by: Guest on July-08-2021
0

Create resource via terraform but do not recreate if manually deleted?

terraform apply -var="bootstrap=true"
terraform state rm azurerm_storage_blob.test
Posted by: Guest on July-08-2021

Code answers related to "Create resource via terraform but do not recreate if manually deleted?"

Browse Popular Code Answers by Language