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

Add Private Service Connect as purpose to resource google_compute_subnetwork #10380

Closed jeheyer closed 2 years ago

jeheyer commented 2 years ago

Community Note

Description

When creating a subnet via Terraform, purpose is currently limited to "PRIVATE" or "INTERNAL_HTTPS_LOAD_BALANCER"

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_compute_subnetwork" "psc-subnet" {
  name              = "psc-service1-us-central1"
  ip_cidr_range  = "192.0.2.0/28"
  region             = "us-central1"
  purpose          = "PRIVATE_SERVICE_CONNECT"
  network          = "my-vpc-network"
}

References

I see two requests for connecting to an already published service but nothing related to publishing a service. A dedicated subnet is the first requirement for publishing a service.

jeheyer commented 2 years ago

Not clear if this is supported in the API yet, even beta:

Method: subnetworks.insert

It has been supported via gcloud and web console for a while.

upodroid commented 2 years ago

Hi

This feature is already supported.

We don't validate the value of purpose.

https://github.com/hashicorp/terraform-provider-google/blob/master/google/resource_compute_subnetwork.go#L196

Thank you

jeheyer commented 2 years ago

Oh I see. Could the documentation be updated so this is clear?

google_compute_subnetwork

github-actions[bot] commented 2 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.