📜  通过 terraform 创建资源,但如果手动删除则不重新创建? - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:22.997000             🧑  作者: Mango

代码示例2
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"
}