hashicorp / terraform-provider-hcp

Terraform provider for HashiCorp Cloud Platform.
Mozilla Public License 2.0
50 stars 47 forks source link

Documentation - There seems to be a mistake in the example code for the hcp_iam_workload_identity_provider resource. #1114

Open itot555 opened 1 month ago

itot555 commented 1 month ago

Terraform Version and Provider Version

Terraform version: 1.9.7
HCP provider version: 0.97.0

Affected Resource(s)

Terraform Configuration Files

resource "hcp_iam_workload_identity_provider" "example" {
  name              = "github-example"
  service_principal = hcp_service_principal.deployment_sp.resource_name
  description       = "Allow acme-repo deploy workflow to access my-app-runtime service principal"

  oidc {
    issuer_uri = "https://token.actions.githubusercontent.com"
  }

  conditional_access = "<CONDITION>"
}

Debug Output

Panic Output

Steps to Reproduce

  1. terraform apply with example code in hcp_iam_workload_identity_provider.

  2. Error output like the following.

  oidc {
Blocks of type "oidc" are not expected here. Did you mean to define argument "oidc"? If so, use the equals sign to assign it a value.

Expected Behavior

The oidc block was defined as an argument and set to a value with = like the following and terraform apply ran successfully.

  oidc = {
    issuer_uri = "https://token.actions.githubusercontent.com"
  }

Actual Behavior

Important Factoids

References

Community Note

jmeisele commented 1 month ago

Ran into this as well and made PR to fix the documentation

https://github.com/hashicorp/terraform-provider-hcp/pull/1115