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.29k stars 1.72k forks source link

The docs need updating for the `name` attribute of `google_recaptcha_enterprise_key` #17062

Open BenJackGill opened 7 months ago

BenJackGill commented 7 months ago

Community Note

Terraform Version

Terraform v1.7.0 on darwin_arm64

Affected Resource(s)

Terraform Configuration Files

resource "google_recaptcha_enterprise_key" "main" {
  provider     = google
  project      = my-project-id
  display_name = "reCaptcha Enterprise Key"

  web_settings {
    integration_type  = "SCORE"
    allow_all_domains = false
    allowed_domains   = [var.domain]
  }

  labels = {}
}

output "recaptcha_enterprise_key_name" {
  value = google_recaptcha_enterprise_key.main.name
}

Expected Behavior

The docs say that the name computed attribute is the resource name for the Key in the format "projects/{project}/keys/{key}".

So as per the docs I was expecting this: projects/my-project-id/keys/my-key-string-123-abc

Actual Behavior

Instead it is returning just the key: my-key-string-123-abc

Note that I like this behaviour because I only want the key. But the docs should be updated to reflect the correct output.

Steps to Reproduce

  1. terraform apply
  2. terraform output
  3. See that name outputs something like my-key-string-123-abc instead of projects/my-project-id/keys/my-key-string-123-abc which is what the docs says.

References

b/321923312

edwardmedia commented 7 months ago

Agreed. the formats of name and id fields should be different

            "id": "projects/myproject/keys/6LecnJAkAAAAABJhGxNwuCQBFzaBaMcaD_AgIY9X",
            "ios_settings": [],
            "labels": {},
            "name": "6LecnJAkAAAAABJhGxNwuCQBFzaBaMcaD_AgIY9X",