hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.34k stars 1.74k forks source link

google_workflows_workflow: call_log_level set to "CALL_LOG_LEVEL_UNSPECIFIED" generate false plan changes #19894

Open DanyC97 opened 3 weeks ago

DanyC97 commented 3 weeks ago

Community Note

Terraform Version & Provider Version(s)

Terraform v1.9.8
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v6.7.0

Affected Resource(s)

Terraform Configuration

provider "google" {
project = "project-test"
}

# Create a dedicated service account
resource "google_service_account" "default" {
  account_id   = "sample-workflows-sa"
  display_name = "Sample Workflows Service Account"
}

# Create a workflow
resource "google_workflows_workflow" "default" {
  name            = "sample-workflow"
  region          = "us-central1"
  description     = "A sample workflow"
  service_account = google_service_account.default.id
  call_log_level = "CALL_LOG_LEVEL_UNSPECIFIED"
  labels = {
    env = "test"
  }
  user_env_vars = {
    url = "https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam"
  }
  source_contents = <<-EOF
  # This is a sample workflow that you can replace with your source code
  #
  # The workflow does the following:
  # - Retrieves the current date from a public API and stores the
  #   response in `currentDate`
  # - Retrieves a list of Wikipedia articles from a public API related
  #   to the day of the week stored in `currentDate`
  # - Returns the list of articles in the workflow output
  #
  # Note that when you define workflows in Terraform, variables must be
  # escaped with two dollar signs ($$) and not a single sign ($)

  - getCurrentDate:
      call: http.get
      args:
          url: $${sys.get_env("url")}
      result: currentDate
  - readWikipedia:
      call: http.get
      args:
          url: https://en.wikipedia.org/w/api.php
          query:
              action: opensearch
              search: $${currentDate.body.dayOfWeek}
      result: wikiResult
  - returnOutput:
      return: $${wikiResult.body[1]}
EOF

}

Debug Output

No response

Expected Behavior

no plan changes

Actual Behavior

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # google_workflows_workflow.default will be updated in-place
  ~ resource "google_workflows_workflow" "default" {
      + call_log_level   = "CALL_LOG_LEVEL_UNSPECIFIED"
        id               = "projects/project-test/locations/us-central1/workflows/sample-workflow"
        name             = "sample-workflow"
        # (13 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to reproduce

  1. terraform apply

Important Factoids

What is interesting is that

References

No response

b/376080369

ggtisc commented 2 weeks ago

Confirmed permadiff issue. This example is based on the terraform registry example