Skip to content

Commit d01c0cd

Browse files
Fixes related to autogenerating the VPN Tunnel resource (hashicorp#1850)
1 parent 35cea55 commit d01c0cd

4 files changed

+28
-2
lines changed

google/resource_compute_region_disk.go

+6
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,9 @@ func flattenComputeRegionDiskSize(v interface{}) interface{} {
602602
}
603603

604604
func flattenComputeRegionDiskType(v interface{}) interface{} {
605+
if v == nil {
606+
return v
607+
}
605608
return NameFromSelfLinkStateFunc(v)
606609
}
607610

@@ -620,6 +623,9 @@ func flattenComputeRegionDiskReplicaZones(v interface{}) interface{} {
620623
}
621624

622625
func flattenComputeRegionDiskRegion(v interface{}) interface{} {
626+
if v == nil {
627+
return v
628+
}
623629
return NameFromSelfLinkStateFunc(v)
624630
}
625631

google/resource_compute_router.go

+3
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ func flattenComputeRouterBgpAdvertisedIpRangesDescription(v interface{}) interfa
470470
}
471471

472472
func flattenComputeRouterRegion(v interface{}) interface{} {
473+
if v == nil {
474+
return v
475+
}
473476
return NameFromSelfLinkStateFunc(v)
474477
}
475478

google/resource_compute_vpn_tunnel.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,10 @@ func flattenComputeVpnTunnelDescription(v interface{}) interface{} {
553553
}
554554

555555
func flattenComputeVpnTunnelTargetVpnGateway(v interface{}) interface{} {
556-
return v
556+
if v == nil {
557+
return v
558+
}
559+
return ConvertSelfLinkToV1(v.(string))
557560
}
558561

559562
func flattenComputeVpnTunnelRouter(v interface{}) interface{} {

website/docs/r/compute_vpn_tunnel.html.markdown

+15-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ resource "google_compute_route" "route1" {
113113

114114
The following arguments are supported:
115115

116+
116117
* `name` -
117118
(Required)
118119
Name of the resource. The name must be 1-63 characters long, and
@@ -122,47 +123,56 @@ The following arguments are supported:
122123
must be a lowercase letter, and all following characters must
123124
be a dash, lowercase letter, or digit,
124125
except the last character, which cannot be a dash.
126+
125127
* `target_vpn_gateway` -
126128
(Required)
127129
URL of the Target VPN gateway with which this VPN tunnel is
128130
associated.
131+
129132
* `peer_ip` -
130133
(Required)
131134
IP address of the peer VPN gateway. Only IPv4 is supported.
135+
132136
* `shared_secret` -
133137
(Required)
134138
Shared secret used to set the secure session between the Cloud VPN
135139
gateway and the peer VPN gateway.
136140

137-
138141
- - -
139142

143+
140144
* `description` -
141145
(Optional)
142146
An optional description of this resource.
147+
143148
* `router` -
144149
(Optional)
145150
URL of router resource to be used for dynamic routing.
151+
146152
* `ike_version` -
147153
(Optional)
148154
IKE protocol version to use when establishing the VPN tunnel with
149155
peer VPN gateway.
150156
Acceptable IKE versions are 1 or 2. Default version is 2.
157+
151158
* `local_traffic_selector` -
152159
(Optional)
153160
Local traffic selector to use when establishing the VPN tunnel with
154161
peer VPN gateway. The value should be a CIDR formatted string,
155162
for example `192.168.0.0/16`. The ranges should be disjoint.
156163
Only IPv4 is supported.
164+
157165
* `remote_traffic_selector` -
158166
(Optional)
159167
Remote traffic selector to use when establishing the VPN tunnel with
160168
peer VPN gateway. The value should be a CIDR formatted string,
161169
for example `192.168.0.0/16`. The ranges should be disjoint.
162170
Only IPv4 is supported.
171+
163172
* `labels` -
164173
(Optional)
165174
Labels to apply to this VpnTunnel.
175+
166176
* `region` -
167177
(Optional)
168178
The region where the tunnel is located.
@@ -174,13 +184,17 @@ The following arguments are supported:
174184

175185
In addition to the arguments listed above, the following computed attributes are exported:
176186

187+
177188
* `creation_timestamp` -
178189
Creation timestamp in RFC3339 text format.
190+
179191
* `shared_secret_hash` -
180192
Hash of the shared secret.
193+
181194
* `label_fingerprint` -
182195
The fingerprint used for optimistic locking of this resource. Used
183196
internally during updates.
197+
184198
* `detailed_status` -
185199
Detailed status message for the VPN tunnel.
186200
* `self_link` - The URI of the created resource.

0 commit comments

Comments
 (0)