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

Missing Private Service Connection related attributes #10588

Closed mmf55 closed 2 years ago

mmf55 commented 2 years ago

Community Note

Description

Currently, the way to create a Private Service Connection (PSC) is using the google_compute_global_forwarding_rule resource, but after the resource creation, not all the PSC-related attributes are available. One example is the PSC connection ID.

New or Affected Resource(s)

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.
resource "google_compute_forwarding_rule" "fr" {
  name   = "test-fr"
  region = var.region

  target                = "projects/project1/regions/us-central1/serviceAttachments/attachment1"
  load_balancing_scheme = "" # need to override EXTERNAL default when target is a service attachment
  network               = "network1"
  ip_address            = google_compute_address.gcaddr.id
}

output "psc_connection_id" {
  value = google_compute_forwarding_rule.fr.psc_connection_id
}

References

Configuring Private Service Connect to access services Compute Forwarding rule documentation

Zawadidone commented 2 years ago

The documentation shows that the field pscConnectionId is available in the API. What are the current options using this provider to receive the pscConnectionId?

midu-git commented 2 years ago

Is there any progress on this issue? This is a quite important feature for us.

I would be happy to support, if someone points me into the right direction.

nielsbox commented 2 years ago

Hi @midu-git @Zawadidone @mmf55 , I created 2 pull requests to add this to the current functionality, any feedback is welcome. https://github.com/hashicorp/terraform-provider-google/pull/11767 https://github.com/GoogleCloudPlatform/declarative-resource-client-library/pull/11

shuyama1 commented 2 years ago

Features added in https://github.com/GoogleCloudPlatform/magic-modules/pull/6124 and the PR just got merged. Therefore, closing this now.

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.