linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20240409] Terraform `removed` block is useful instead of `terraform rm state` in v1.7 or later. #200

Open linzhengen opened 3 months ago

linzhengen commented 3 months ago

Doc

https://developer.hashicorp.com/terraform/language/resources/syntax#removing-resources

Example

removed {
  from = google_cloud_run_service.my-service
  lifecycle {
    destroy = false
  }
}

# resource "google_cloud_run_service" "my-service" {
#  name     = "my-service-api"
#...
#}