Skip to content

lifecycle meta-argument cannot be updated in state after the resource is created #37575

@frankcaoyun

Description

@frankcaoyun

Terraform Version

Terraform v1.13.1
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v6.19.0
+ provider registry.terraform.io/hashicorp/null v3.2.4

Terraform Configuration Files

resource "google_compute_region_ssl_certificate" "test_ssl_certificate" {
  name_prefix = "test-ssl-certificate"
  description = "Test SSL Certificate"
  region      = "europe-west4"
  private_key = data.google_secret_manager_secret_version.test_ssl_key_file.secret_data
  certificate = data.google_secret_manager_secret_version.test_ssl_crt_file.secret_data
  lifecycle {
    create_before_destroy = false
  }
}

Debug Output

NA

Expected Behavior

When the value for create_before_destroy is added / removed / updated, it should show the diff in the terrraform plan / apply output.

Actual Behavior

"No changes. Your infrastructure matches the configuration."

Steps to Reproduce

  1. Create a resource (I've tested with google_compute_region_ssl_certificate, google_compute_instance_template, google_compute_region_target_https_proxy, google_compute_region_url_map) with (or without) lifecycle {create_before_destroy = true}
  2. After the resource is created, confirm that the lifecycle block exists in the resource state file
  3. Update / remove (or add) the value of the create_before_destroy key
  4. Run terraform plan
  5. You should see "No changes..."

Additional Context

No response

References

No response

Generative AI / LLM assisted development?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnewnew issue not yet triagedwaiting-responseAn issue/pull request is waiting for a response from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions