/
subnetwork.go
455 lines (397 loc) · 45.9 KB
/
subnetwork.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package alpha
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a subnetwork in the specified project using the data included in the request.
type Subnetwork struct {
pulumi.CustomResourceState
// Can only be specified if VPC flow logging for this subnetwork is enabled. Sets the aggregation interval for collecting flow logs. Increasing the interval time reduces the amount of generated flow logs for long-lasting connections. Default is an interval of 5 seconds per connection. Valid values: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
AggregationInterval pulumi.StringOutput `pulumi:"aggregationInterval"`
// Whether this subnetwork's ranges can conflict with existing static routes. Setting this to true allows this subnetwork's primary and secondary ranges to overlap with (and contain) static routes that have already been configured on the corresponding network. For example if a static route has range 10.1.0.0/16, a subnet range 10.0.0.0/8 could only be created if allow_conflicting_routes=true. Overlapping is only allowed on subnetwork operations; routes whose ranges conflict with this subnetwork's ranges won't be allowed unless route.allow_conflicting_subnetworks is set to true. Typically packets destined to IPs within the subnetwork (which may contain private/sensitive data) are prevented from leaving the virtual network. Setting this field to true will disable this feature. The default value is false and applies to all existing subnetworks and automatically created subnetworks. This field cannot be set to true at resource creation time.
AllowSubnetCidrRoutesOverlap pulumi.BoolOutput `pulumi:"allowSubnetCidrRoutesOverlap"`
// Creation timestamp in RFC3339 text format.
CreationTimestamp pulumi.StringOutput `pulumi:"creationTimestamp"`
// An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
Description pulumi.StringOutput `pulumi:"description"`
// Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
EnableFlowLogs pulumi.BoolOutput `pulumi:"enableFlowLogs"`
// Enables Layer2 communication on the subnetwork.
EnableL2 pulumi.BoolOutput `pulumi:"enableL2"`
// Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
//
// Deprecated: Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
EnablePrivateV6Access pulumi.BoolOutput `pulumi:"enablePrivateV6Access"`
// The external IPv6 address range that is owned by this subnetwork.
ExternalIpv6Prefix pulumi.StringOutput `pulumi:"externalIpv6Prefix"`
// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a Subnetwork.
Fingerprint pulumi.StringOutput `pulumi:"fingerprint"`
// Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
FlowSampling pulumi.Float64Output `pulumi:"flowSampling"`
// The gateway address for default routes to reach destination addresses outside this subnetwork.
GatewayAddress pulumi.StringOutput `pulumi:"gatewayAddress"`
// The internal IPv6 address range that is assigned to this subnetwork.
InternalIpv6Prefix pulumi.StringOutput `pulumi:"internalIpv6Prefix"`
// The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange.
IpCidrRange pulumi.StringOutput `pulumi:"ipCidrRange"`
// The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.
Ipv6AccessType pulumi.StringOutput `pulumi:"ipv6AccessType"`
// This field is for internal use.
Ipv6CidrRange pulumi.StringOutput `pulumi:"ipv6CidrRange"`
// Type of the resource. Always compute#subnetwork for Subnetwork resources.
Kind pulumi.StringOutput `pulumi:"kind"`
// This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging.
LogConfig SubnetworkLogConfigResponseOutput `pulumi:"logConfig"`
// Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Options are INCLUDE_ALL_METADATA, EXCLUDE_ALL_METADATA, and CUSTOM_METADATA. Default is EXCLUDE_ALL_METADATA.
Metadata pulumi.StringOutput `pulumi:"metadata"`
// The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Name pulumi.StringOutput `pulumi:"name"`
// The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time.
Network pulumi.StringOutput `pulumi:"network"`
// Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess.
PrivateIpGoogleAccess pulumi.BoolOutput `pulumi:"privateIpGoogleAccess"`
// This field is for internal use. This field can be both set at resource creation time and updated using patch.
PrivateIpv6GoogleAccess pulumi.StringOutput `pulumi:"privateIpv6GoogleAccess"`
Project pulumi.StringOutput `pulumi:"project"`
// The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or INTERNAL_HTTPS_LOAD_BALANCER. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a proxy-only subnet that can be used only by regional internal HTTP(S) load balancers. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
Purpose pulumi.StringOutput `pulumi:"purpose"`
Region pulumi.StringOutput `pulumi:"region"`
// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
RequestId pulumi.StringPtrOutput `pulumi:"requestId"`
// The URL of the reserved internal range.
ReservedInternalRange pulumi.StringOutput `pulumi:"reservedInternalRange"`
// The role of subnetwork. Currently, this field is only used when purpose = REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.
Role pulumi.StringOutput `pulumi:"role"`
// An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request.
SecondaryIpRanges SubnetworkSecondaryRangeResponseArrayOutput `pulumi:"secondaryIpRanges"`
// Server-defined URL for the resource.
SelfLink pulumi.StringOutput `pulumi:"selfLink"`
// Server-defined URL for this resource with the resource id.
SelfLinkWithId pulumi.StringOutput `pulumi:"selfLinkWithId"`
// The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.
StackType pulumi.StringOutput `pulumi:"stackType"`
// The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY
State pulumi.StringOutput `pulumi:"state"`
// A repeated field indicating the VLAN IDs supported on this subnetwork. During Subnet creation, specifying vlan is valid only if enable_l2 is true. During Subnet Update, specifying vlan is allowed only for l2 enabled subnets. Restricted to only one VLAN.
Vlans pulumi.IntArrayOutput `pulumi:"vlans"`
}
// NewSubnetwork registers a new resource with the given unique name, arguments, and options.
func NewSubnetwork(ctx *pulumi.Context,
name string, args *SubnetworkArgs, opts ...pulumi.ResourceOption) (*Subnetwork, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Region == nil {
return nil, errors.New("invalid value for required argument 'Region'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"project",
"region",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Subnetwork
err := ctx.RegisterResource("google-native:compute/alpha:Subnetwork", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSubnetwork gets an existing Subnetwork resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSubnetwork(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SubnetworkState, opts ...pulumi.ResourceOption) (*Subnetwork, error) {
var resource Subnetwork
err := ctx.ReadResource("google-native:compute/alpha:Subnetwork", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Subnetwork resources.
type subnetworkState struct {
}
type SubnetworkState struct {
}
func (SubnetworkState) ElementType() reflect.Type {
return reflect.TypeOf((*subnetworkState)(nil)).Elem()
}
type subnetworkArgs struct {
// Can only be specified if VPC flow logging for this subnetwork is enabled. Sets the aggregation interval for collecting flow logs. Increasing the interval time reduces the amount of generated flow logs for long-lasting connections. Default is an interval of 5 seconds per connection. Valid values: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
AggregationInterval *SubnetworkAggregationInterval `pulumi:"aggregationInterval"`
// Whether this subnetwork's ranges can conflict with existing static routes. Setting this to true allows this subnetwork's primary and secondary ranges to overlap with (and contain) static routes that have already been configured on the corresponding network. For example if a static route has range 10.1.0.0/16, a subnet range 10.0.0.0/8 could only be created if allow_conflicting_routes=true. Overlapping is only allowed on subnetwork operations; routes whose ranges conflict with this subnetwork's ranges won't be allowed unless route.allow_conflicting_subnetworks is set to true. Typically packets destined to IPs within the subnetwork (which may contain private/sensitive data) are prevented from leaving the virtual network. Setting this field to true will disable this feature. The default value is false and applies to all existing subnetworks and automatically created subnetworks. This field cannot be set to true at resource creation time.
AllowSubnetCidrRoutesOverlap *bool `pulumi:"allowSubnetCidrRoutesOverlap"`
// An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
Description *string `pulumi:"description"`
// Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
EnableFlowLogs *bool `pulumi:"enableFlowLogs"`
// Enables Layer2 communication on the subnetwork.
EnableL2 *bool `pulumi:"enableL2"`
// Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
//
// Deprecated: Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
EnablePrivateV6Access *bool `pulumi:"enablePrivateV6Access"`
// The external IPv6 address range that is owned by this subnetwork.
ExternalIpv6Prefix *string `pulumi:"externalIpv6Prefix"`
// Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
FlowSampling *float64 `pulumi:"flowSampling"`
// The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange.
IpCidrRange *string `pulumi:"ipCidrRange"`
// The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.
Ipv6AccessType *SubnetworkIpv6AccessType `pulumi:"ipv6AccessType"`
// This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging.
LogConfig *SubnetworkLogConfig `pulumi:"logConfig"`
// Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Options are INCLUDE_ALL_METADATA, EXCLUDE_ALL_METADATA, and CUSTOM_METADATA. Default is EXCLUDE_ALL_METADATA.
Metadata *SubnetworkMetadata `pulumi:"metadata"`
// The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Name *string `pulumi:"name"`
// The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time.
Network *string `pulumi:"network"`
// Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess.
PrivateIpGoogleAccess *bool `pulumi:"privateIpGoogleAccess"`
// This field is for internal use. This field can be both set at resource creation time and updated using patch.
PrivateIpv6GoogleAccess *SubnetworkPrivateIpv6GoogleAccess `pulumi:"privateIpv6GoogleAccess"`
Project *string `pulumi:"project"`
// The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or INTERNAL_HTTPS_LOAD_BALANCER. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a proxy-only subnet that can be used only by regional internal HTTP(S) load balancers. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
Purpose *SubnetworkPurpose `pulumi:"purpose"`
// URL of the region where the Subnetwork resides. This field can be set only at resource creation time.
Region string `pulumi:"region"`
// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
RequestId *string `pulumi:"requestId"`
// The URL of the reserved internal range.
ReservedInternalRange *string `pulumi:"reservedInternalRange"`
// The role of subnetwork. Currently, this field is only used when purpose = REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.
Role *SubnetworkRole `pulumi:"role"`
// An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request.
SecondaryIpRanges []SubnetworkSecondaryRange `pulumi:"secondaryIpRanges"`
// The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.
StackType *SubnetworkStackType `pulumi:"stackType"`
// A repeated field indicating the VLAN IDs supported on this subnetwork. During Subnet creation, specifying vlan is valid only if enable_l2 is true. During Subnet Update, specifying vlan is allowed only for l2 enabled subnets. Restricted to only one VLAN.
Vlans []int `pulumi:"vlans"`
}
// The set of arguments for constructing a Subnetwork resource.
type SubnetworkArgs struct {
// Can only be specified if VPC flow logging for this subnetwork is enabled. Sets the aggregation interval for collecting flow logs. Increasing the interval time reduces the amount of generated flow logs for long-lasting connections. Default is an interval of 5 seconds per connection. Valid values: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
AggregationInterval SubnetworkAggregationIntervalPtrInput
// Whether this subnetwork's ranges can conflict with existing static routes. Setting this to true allows this subnetwork's primary and secondary ranges to overlap with (and contain) static routes that have already been configured on the corresponding network. For example if a static route has range 10.1.0.0/16, a subnet range 10.0.0.0/8 could only be created if allow_conflicting_routes=true. Overlapping is only allowed on subnetwork operations; routes whose ranges conflict with this subnetwork's ranges won't be allowed unless route.allow_conflicting_subnetworks is set to true. Typically packets destined to IPs within the subnetwork (which may contain private/sensitive data) are prevented from leaving the virtual network. Setting this field to true will disable this feature. The default value is false and applies to all existing subnetworks and automatically created subnetworks. This field cannot be set to true at resource creation time.
AllowSubnetCidrRoutesOverlap pulumi.BoolPtrInput
// An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
Description pulumi.StringPtrInput
// Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
EnableFlowLogs pulumi.BoolPtrInput
// Enables Layer2 communication on the subnetwork.
EnableL2 pulumi.BoolPtrInput
// Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
//
// Deprecated: Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
EnablePrivateV6Access pulumi.BoolPtrInput
// The external IPv6 address range that is owned by this subnetwork.
ExternalIpv6Prefix pulumi.StringPtrInput
// Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
FlowSampling pulumi.Float64PtrInput
// The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange.
IpCidrRange pulumi.StringPtrInput
// The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.
Ipv6AccessType SubnetworkIpv6AccessTypePtrInput
// This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging.
LogConfig SubnetworkLogConfigPtrInput
// Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Options are INCLUDE_ALL_METADATA, EXCLUDE_ALL_METADATA, and CUSTOM_METADATA. Default is EXCLUDE_ALL_METADATA.
Metadata SubnetworkMetadataPtrInput
// The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Name pulumi.StringPtrInput
// The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time.
Network pulumi.StringPtrInput
// Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess.
PrivateIpGoogleAccess pulumi.BoolPtrInput
// This field is for internal use. This field can be both set at resource creation time and updated using patch.
PrivateIpv6GoogleAccess SubnetworkPrivateIpv6GoogleAccessPtrInput
Project pulumi.StringPtrInput
// The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or INTERNAL_HTTPS_LOAD_BALANCER. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a proxy-only subnet that can be used only by regional internal HTTP(S) load balancers. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
Purpose SubnetworkPurposePtrInput
// URL of the region where the Subnetwork resides. This field can be set only at resource creation time.
Region pulumi.StringInput
// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
RequestId pulumi.StringPtrInput
// The URL of the reserved internal range.
ReservedInternalRange pulumi.StringPtrInput
// The role of subnetwork. Currently, this field is only used when purpose = REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.
Role SubnetworkRolePtrInput
// An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request.
SecondaryIpRanges SubnetworkSecondaryRangeArrayInput
// The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.
StackType SubnetworkStackTypePtrInput
// A repeated field indicating the VLAN IDs supported on this subnetwork. During Subnet creation, specifying vlan is valid only if enable_l2 is true. During Subnet Update, specifying vlan is allowed only for l2 enabled subnets. Restricted to only one VLAN.
Vlans pulumi.IntArrayInput
}
func (SubnetworkArgs) ElementType() reflect.Type {
return reflect.TypeOf((*subnetworkArgs)(nil)).Elem()
}
type SubnetworkInput interface {
pulumi.Input
ToSubnetworkOutput() SubnetworkOutput
ToSubnetworkOutputWithContext(ctx context.Context) SubnetworkOutput
}
func (*Subnetwork) ElementType() reflect.Type {
return reflect.TypeOf((**Subnetwork)(nil)).Elem()
}
func (i *Subnetwork) ToSubnetworkOutput() SubnetworkOutput {
return i.ToSubnetworkOutputWithContext(context.Background())
}
func (i *Subnetwork) ToSubnetworkOutputWithContext(ctx context.Context) SubnetworkOutput {
return pulumi.ToOutputWithContext(ctx, i).(SubnetworkOutput)
}
type SubnetworkOutput struct{ *pulumi.OutputState }
func (SubnetworkOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Subnetwork)(nil)).Elem()
}
func (o SubnetworkOutput) ToSubnetworkOutput() SubnetworkOutput {
return o
}
func (o SubnetworkOutput) ToSubnetworkOutputWithContext(ctx context.Context) SubnetworkOutput {
return o
}
// Can only be specified if VPC flow logging for this subnetwork is enabled. Sets the aggregation interval for collecting flow logs. Increasing the interval time reduces the amount of generated flow logs for long-lasting connections. Default is an interval of 5 seconds per connection. Valid values: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
func (o SubnetworkOutput) AggregationInterval() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.AggregationInterval }).(pulumi.StringOutput)
}
// Whether this subnetwork's ranges can conflict with existing static routes. Setting this to true allows this subnetwork's primary and secondary ranges to overlap with (and contain) static routes that have already been configured on the corresponding network. For example if a static route has range 10.1.0.0/16, a subnet range 10.0.0.0/8 could only be created if allow_conflicting_routes=true. Overlapping is only allowed on subnetwork operations; routes whose ranges conflict with this subnetwork's ranges won't be allowed unless route.allow_conflicting_subnetworks is set to true. Typically packets destined to IPs within the subnetwork (which may contain private/sensitive data) are prevented from leaving the virtual network. Setting this field to true will disable this feature. The default value is false and applies to all existing subnetworks and automatically created subnetworks. This field cannot be set to true at resource creation time.
func (o SubnetworkOutput) AllowSubnetCidrRoutesOverlap() pulumi.BoolOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.BoolOutput { return v.AllowSubnetCidrRoutesOverlap }).(pulumi.BoolOutput)
}
// Creation timestamp in RFC3339 text format.
func (o SubnetworkOutput) CreationTimestamp() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.CreationTimestamp }).(pulumi.StringOutput)
}
// An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
func (o SubnetworkOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
func (o SubnetworkOutput) EnableFlowLogs() pulumi.BoolOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.BoolOutput { return v.EnableFlowLogs }).(pulumi.BoolOutput)
}
// Enables Layer2 communication on the subnetwork.
func (o SubnetworkOutput) EnableL2() pulumi.BoolOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.BoolOutput { return v.EnableL2 }).(pulumi.BoolOutput)
}
// Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
//
// Deprecated: Deprecated in favor of enable in PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly access Google services via internal IPv6 addresses. This field can be both set at resource creation time and updated using patch.
func (o SubnetworkOutput) EnablePrivateV6Access() pulumi.BoolOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.BoolOutput { return v.EnablePrivateV6Access }).(pulumi.BoolOutput)
}
// The external IPv6 address range that is owned by this subnetwork.
func (o SubnetworkOutput) ExternalIpv6Prefix() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.ExternalIpv6Prefix }).(pulumi.StringOutput)
}
// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a Subnetwork.
func (o SubnetworkOutput) Fingerprint() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Fingerprint }).(pulumi.StringOutput)
}
// Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
func (o SubnetworkOutput) FlowSampling() pulumi.Float64Output {
return o.ApplyT(func(v *Subnetwork) pulumi.Float64Output { return v.FlowSampling }).(pulumi.Float64Output)
}
// The gateway address for default routes to reach destination addresses outside this subnetwork.
func (o SubnetworkOutput) GatewayAddress() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.GatewayAddress }).(pulumi.StringOutput)
}
// The internal IPv6 address range that is assigned to this subnetwork.
func (o SubnetworkOutput) InternalIpv6Prefix() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.InternalIpv6Prefix }).(pulumi.StringOutput)
}
// The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange.
func (o SubnetworkOutput) IpCidrRange() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.IpCidrRange }).(pulumi.StringOutput)
}
// The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.
func (o SubnetworkOutput) Ipv6AccessType() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Ipv6AccessType }).(pulumi.StringOutput)
}
// This field is for internal use.
func (o SubnetworkOutput) Ipv6CidrRange() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Ipv6CidrRange }).(pulumi.StringOutput)
}
// Type of the resource. Always compute#subnetwork for Subnetwork resources.
func (o SubnetworkOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Kind }).(pulumi.StringOutput)
}
// This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging.
func (o SubnetworkOutput) LogConfig() SubnetworkLogConfigResponseOutput {
return o.ApplyT(func(v *Subnetwork) SubnetworkLogConfigResponseOutput { return v.LogConfig }).(SubnetworkLogConfigResponseOutput)
}
// Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Options are INCLUDE_ALL_METADATA, EXCLUDE_ALL_METADATA, and CUSTOM_METADATA. Default is EXCLUDE_ALL_METADATA.
func (o SubnetworkOutput) Metadata() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Metadata }).(pulumi.StringOutput)
}
// The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
func (o SubnetworkOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time.
func (o SubnetworkOutput) Network() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Network }).(pulumi.StringOutput)
}
// Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess.
func (o SubnetworkOutput) PrivateIpGoogleAccess() pulumi.BoolOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.BoolOutput { return v.PrivateIpGoogleAccess }).(pulumi.BoolOutput)
}
// This field is for internal use. This field can be both set at resource creation time and updated using patch.
func (o SubnetworkOutput) PrivateIpv6GoogleAccess() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.PrivateIpv6GoogleAccess }).(pulumi.StringOutput)
}
func (o SubnetworkOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or INTERNAL_HTTPS_LOAD_BALANCER. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a proxy-only subnet that can be used only by regional internal HTTP(S) load balancers. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
func (o SubnetworkOutput) Purpose() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Purpose }).(pulumi.StringOutput)
}
func (o SubnetworkOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
func (o SubnetworkOutput) RequestId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringPtrOutput { return v.RequestId }).(pulumi.StringPtrOutput)
}
// The URL of the reserved internal range.
func (o SubnetworkOutput) ReservedInternalRange() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.ReservedInternalRange }).(pulumi.StringOutput)
}
// The role of subnetwork. Currently, this field is only used when purpose = REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.
func (o SubnetworkOutput) Role() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.Role }).(pulumi.StringOutput)
}
// An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request.
func (o SubnetworkOutput) SecondaryIpRanges() SubnetworkSecondaryRangeResponseArrayOutput {
return o.ApplyT(func(v *Subnetwork) SubnetworkSecondaryRangeResponseArrayOutput { return v.SecondaryIpRanges }).(SubnetworkSecondaryRangeResponseArrayOutput)
}
// Server-defined URL for the resource.
func (o SubnetworkOutput) SelfLink() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.SelfLink }).(pulumi.StringOutput)
}
// Server-defined URL for this resource with the resource id.
func (o SubnetworkOutput) SelfLinkWithId() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.SelfLinkWithId }).(pulumi.StringOutput)
}
// The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.
func (o SubnetworkOutput) StackType() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.StackType }).(pulumi.StringOutput)
}
// The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY
func (o SubnetworkOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// A repeated field indicating the VLAN IDs supported on this subnetwork. During Subnet creation, specifying vlan is valid only if enable_l2 is true. During Subnet Update, specifying vlan is allowed only for l2 enabled subnets. Restricted to only one VLAN.
func (o SubnetworkOutput) Vlans() pulumi.IntArrayOutput {
return o.ApplyT(func(v *Subnetwork) pulumi.IntArrayOutput { return v.Vlans }).(pulumi.IntArrayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SubnetworkInput)(nil)).Elem(), &Subnetwork{})
pulumi.RegisterOutputType(SubnetworkOutput{})
}