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

Add field reserved_internal_range and range to allow integration with the Internal Ranges API #17881

Closed daanheikens closed 2 weeks ago

daanheikens commented 4 months ago

Community Note

Description

Recently the Internal Ranges API became Generally Available to be used. Integration with the subnetwork resource was not yet present aswell as the Internal Ranges API resource. (PR here: https://github.com/GoogleCloudPlatform/magic-modules/pull/10465)

To integrate the Internal Ranges API with the Subnetwork resource, the field reserved_internal_range needs to be added. The gcloud sdk also provides the range argument but this seems to be a gcloud specific argument.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_compute_subnetwork" "full_range" {
  name                     = "full-range"
  region                   = "europe-west4"
  network                  = google_compute_network.default.name
  reserved_internal_range  = google_network_connectivity_internal_range.default.id
  private_ip_google_access = true
}

# OR

resource "google_compute_subnetwork" "partial_range" {
  name                     = "partial_range"
  region                   = "europe-west4"
  network                  = google_compute_network.default.name
  reserved_internal_range  = google_network_connectivity_internal_range.default.id
  ip_cidr_range            = "10.0.0.0/29"
  private_ip_google_access = true
}

References

https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.internalRanges https://cloud.google.com/compute/docs/reference/rest/v1/subnetworks

b/336319050

daanheikens commented 4 months ago

Since this PR: https://github.com/GoogleCloudPlatform/magic-modules/pull/10465 is now merged, this one can be picked up. Will do that asap to integrate the subnetworks with the Internal Ranges API.

c2thorn commented 3 months ago

@daanheikens can you resend the pull request and ping @trodge on it? It will sit until the 6.0.0 feature branches are ready

@trodge you should apply the "stop review reminders" label to it

daanheikens commented 3 months ago

@daanheikens can you resend the pull request and ping @trodge on it? It will sit until the 6.0.0 feature branches are ready

@trodge you should apply the "stop review reminders" label to it

Sure! Will do that. I believe it does require some extra effort to fix the issue in which i do need some support with. I will make sure to raise my questions on the PR. Thanks @c2thorn

c2thorn commented 2 weeks ago

This has been added to the 6.0 branch. The breaking change part of it has moved to a part of https://github.com/hashicorp/terraform-provider-google/issues/12824

The new field will no longer be a breaking change, but the removal of schema.ConfigModeAttr to the parent field will be.