File tree Expand file tree Collapse file tree 10 files changed +36
-14
lines changed
examples/secondary_ranges Expand file tree Collapse file tree 10 files changed +36
-14
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ ranges and the third being given a single secondary range.
1717
1818| Name | Description |
1919| ------| -------------|
20+ | internal\_ range\_ id | The ID of the created internal range |
21+ | internal\_ range\_ name | The name of the created internal range |
2022| network\_ name | The name of the VPC being created |
2123| network\_ self\_ link | The URI of the VPC being created |
2224| project\_ id | VPC project id |
Original file line number Diff line number Diff line change @@ -76,11 +76,10 @@ module "vpc-secondary-ranges" {
7676 range_name = " ${ local . subnet_03 } -01"
7777 ip_cidr_range = " 192.168.66.0/24"
7878 },
79- # Example of using reserved_internal_range instead of ip_cidr_range
80- # {
81- # range_name = "${local.subnet_03}-02"
82- # reserved_internal_range = "networkconnectivity.googleapis.com/projects/my-project/locations/global/internalRanges/my-range"
83- # },
79+ {
80+ range_name = " ${ local . subnet_03 } -02"
81+ reserved_internal_range = " networkconnectivity.googleapis.com/${ google_network_connectivity_internal_range . internal_range . id } "
82+ },
8483 ]
8584 }
8685
@@ -108,3 +107,13 @@ module "vpc-secondary-ranges" {
108107 },
109108 ]
110109}
110+
111+ resource "google_network_connectivity_internal_range" "internal_range" {
112+ project = var. project_id
113+ name = " ${ var . network_name } -internal-range"
114+ description = " Example internal range for secondary subnet ranges"
115+ ip_cidr_range = " 172.16.0.0/24"
116+ network = module. vpc-secondary-ranges . network_id
117+ usage = " FOR_VPC"
118+ peering = " FOR_SELF"
119+ }
Original file line number Diff line number Diff line change @@ -63,3 +63,13 @@ output "route_names" {
6363 value = module. vpc-secondary-ranges . route_names
6464 description = " The routes associated with this VPC"
6565}
66+
67+ output "internal_range_id" {
68+ value = google_network_connectivity_internal_range. internal_range . id
69+ description = " The ID of the created internal range"
70+ }
71+
72+ output "internal_range_name" {
73+ value = google_network_connectivity_internal_range. internal_range . name
74+ description = " The name of the created internal range"
75+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ terraform {
1919
2020 required_providers {
2121 google = {
22- source = " hashicorp/google"
22+ source = " hashicorp/google"
23+ version = " >= 6.0"
2324 }
2425 null = {
2526 version = " >= 3.0"
Original file line number Diff line number Diff line change @@ -354,6 +354,6 @@ spec:
354354 - servicenetworking.googleapis.com
355355 providerVersions :
356356 - source : hashicorp/google
357- version : " >= 4.64 , < 8"
357+ version : " >= 6.0 , < 8"
358358 - source : hashicorp/google-beta
359- version : " >= 4.64 , < 8"
359+ version : " >= 6.0 , < 8"
Original file line number Diff line number Diff line change @@ -161,4 +161,4 @@ spec:
161161 - servicenetworking.googleapis.com
162162 providerVersions :
163163 - source : hashicorp/google-beta
164- version : " >= 2.19 , < 8"
164+ version : " >= 6.0 , < 8"
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ terraform {
2020 required_providers {
2121 google-beta = {
2222 source = " hashicorp/google-beta"
23- version = " >= 2.19 , < 8"
23+ version = " >= 6.0 , < 8"
2424 }
2525 }
2626
Original file line number Diff line number Diff line change @@ -157,4 +157,4 @@ spec:
157157 - servicenetworking.googleapis.com
158158 providerVersions :
159159 - source : hashicorp/google
160- version : " >= 4.25 .0, < 8"
160+ version : " >= 6 .0, < 8"
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ terraform {
2020 required_providers {
2121 google = {
2222 source = " hashicorp/google"
23- version = " >= 4.25 .0, < 8"
23+ version = " >= 6 .0, < 8"
2424 }
2525 }
2626
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ terraform {
1919 required_providers {
2020 google = {
2121 source = " hashicorp/google"
22- version = " >= 4.64 , < 8"
22+ version = " >= 6.0 , < 8"
2323 }
2424 google-beta = {
2525 source = " hashicorp/google-beta"
26- version = " >= 4.64 , < 8"
26+ version = " >= 6.0 , < 8"
2727 }
2828 }
2929
You can’t perform that action at this time.
0 commit comments