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

Allow pairing_key to accept input when interconnect_attachment type is partner_provider #8239

Open jfeng-dev opened 3 years ago

jfeng-dev commented 3 years ago

Community Note

Description

I'm willing to do the work for this in the Magic Modules

The terraform provider doesn't support an input for the pairing_key field when type is PARTNER_PROVIDER, though type supports value PARTNER_PROVIDER currently. Terraform Doc GCP Doc

There could be a new input key partner_pairing_key to avoid the COMPUTED + OPTIONAL issue that might come up if pairing_key was optional input and sometimes output or empty. Would this be the right path to go down?

The use case would be provisioning interconnect attachments as a Partner Provider. It would complete the workflow initiated by the current PARTNER functionality set up. Admittedly, it's fairly niche.

We might have access to a Partner Interconnect for testing in a few weeks.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_compute_interconnect_attachment" "attachment" {
  name                             = var.name
  router                           = google_compute_router.router.id
  type                             = "PARTNER_PROVIDER"
  partner_pairing_key              = "XXXX/region/domain
}

References

https://github.com/hashicorp/terraform-provider-google/issues/4326 https://github.com/GoogleCloudPlatform/magic-modules/pull/1323 https://github.com/hashicorp/terraform/issues/21278

b/359561794

ggtisc commented 3 months ago

A proposal for the pairing_key argument to be available not only for type PARTNER for the google_compute_interconnect_attachment resource.

roaks3 commented 1 month ago

Note: https://github.com/GoogleCloudPlatform/magic-modules/pull/4480 looks like a feasible solution, but it stalled out due to CLA. Someone may be able to just carry that work forward.