Skip to content

google_network_connectivity_spoke: add include_export_ranges #8088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/11609.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
networkconnectivity: added `include_export_ranges` to `google_network_connectivity_spoke`
```
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ Please refer to the field 'effective_labels' for all of the labels present on th
Type: schema.TypeString,
},
},
"include_export_ranges": {
Type: schema.TypeList,
Optional: true,
ForceNew: true,
Description: `IP ranges allowed to be included from peering.`,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
},
},
ConflictsWith: []string{"linked_interconnect_attachments", "linked_router_appliance_instances", "linked_vpn_tunnels"},
Expand Down Expand Up @@ -765,6 +774,8 @@ func flattenNetworkConnectivitySpokeLinkedVpcNetwork(v interface{}, d *schema.Re
flattenNetworkConnectivitySpokeLinkedVpcNetworkUri(original["uri"], d, config)
transformed["exclude_export_ranges"] =
flattenNetworkConnectivitySpokeLinkedVpcNetworkExcludeExportRanges(original["excludeExportRanges"], d, config)
transformed["include_export_ranges"] =
flattenNetworkConnectivitySpokeLinkedVpcNetworkIncludeExportRanges(original["includeExportRanges"], d, config)
return []interface{}{transformed}
}
func flattenNetworkConnectivitySpokeLinkedVpcNetworkUri(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
Expand All @@ -775,6 +786,10 @@ func flattenNetworkConnectivitySpokeLinkedVpcNetworkExcludeExportRanges(v interf
return v
}

func flattenNetworkConnectivitySpokeLinkedVpcNetworkIncludeExportRanges(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
}

func flattenNetworkConnectivitySpokeUniqueId(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
}
Expand Down Expand Up @@ -972,6 +987,13 @@ func expandNetworkConnectivitySpokeLinkedVpcNetwork(v interface{}, d tpgresource
transformed["excludeExportRanges"] = transformedExcludeExportRanges
}

transformedIncludeExportRanges, err := expandNetworkConnectivitySpokeLinkedVpcNetworkIncludeExportRanges(original["include_export_ranges"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedIncludeExportRanges); val.IsValid() && !tpgresource.IsEmptyValue(val) {
transformed["includeExportRanges"] = transformedIncludeExportRanges
}

return transformed, nil
}

Expand All @@ -983,6 +1005,10 @@ func expandNetworkConnectivitySpokeLinkedVpcNetworkExcludeExportRanges(v interfa
return v, nil
}

func expandNetworkConnectivitySpokeLinkedVpcNetworkIncludeExportRanges(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandNetworkConnectivitySpokeEffectiveLabels(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]string, error) {
if v == nil {
return map[string]string{}, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ resource "google_network_connectivity_spoke" "primary" {
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ resource "google_network_connectivity_spoke" "primary" {
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
}
Expand Down Expand Up @@ -217,6 +221,10 @@ resource "google_network_connectivity_spoke" "primary" {
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
}
Expand Down Expand Up @@ -377,6 +385,10 @@ resource "google_network_connectivity_spoke" "primary" {
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
}
Expand Down Expand Up @@ -412,6 +424,10 @@ resource "google_network_connectivity_spoke" "primary" {
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
}
Expand Down
8 changes: 8 additions & 0 deletions website/docs/r/network_connectivity_spoke.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ resource "google_network_connectivity_spoke" "primary" {
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
}
Expand Down Expand Up @@ -242,6 +246,10 @@ The following arguments are supported:
(Optional)
IP ranges encompassing the subnets to be excluded from peering.

* `include_export_ranges` -
(Optional)
IP ranges allowed to be included from peering.

## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:
Expand Down