/
regionNetworkFirewallPolicyRule.go
637 lines (576 loc) · 34.2 KB
/
regionNetworkFirewallPolicyRule.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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The Compute NetworkFirewallPolicyRule resource
//
// ## Example Usage
//
// ### Regional
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
// "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
// "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/tags"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// basicRegionalNetworksecurityAddressGroup, err := networksecurity.NewAddressGroup(ctx, "basic_regional_networksecurity_address_group", &networksecurity.AddressGroupArgs{
// Name: pulumi.String("policy"),
// Parent: pulumi.String("projects/my-project-name"),
// Description: pulumi.String("Sample regional networksecurity_address_group"),
// Location: pulumi.String("us-west1"),
// Items: pulumi.StringArray{
// pulumi.String("208.80.154.224/32"),
// },
// Type: pulumi.String("IPV4"),
// Capacity: pulumi.Int(100),
// })
// if err != nil {
// return err
// }
// basicRegionalNetworkFirewallPolicy, err := compute.NewRegionNetworkFirewallPolicy(ctx, "basic_regional_network_firewall_policy", &compute.RegionNetworkFirewallPolicyArgs{
// Name: pulumi.String("policy"),
// Description: pulumi.String("Sample regional network firewall policy"),
// Project: pulumi.String("my-project-name"),
// Region: pulumi.String("us-west1"),
// })
// if err != nil {
// return err
// }
// basicNetwork, err := compute.NewNetwork(ctx, "basic_network", &compute.NetworkArgs{
// Name: pulumi.String("network"),
// })
// if err != nil {
// return err
// }
// basicKey, err := tags.NewTagKey(ctx, "basic_key", &tags.TagKeyArgs{
// Description: pulumi.String("For keyname resources."),
// Parent: pulumi.String("organizations/123456789"),
// Purpose: pulumi.String("GCE_FIREWALL"),
// ShortName: pulumi.String("tagkey"),
// PurposeData: pulumi.StringMap{
// "network": basicNetwork.Name.ApplyT(func(name string) (string, error) {
// return fmt.Sprintf("my-project-name/%v", name), nil
// }).(pulumi.StringOutput),
// },
// })
// if err != nil {
// return err
// }
// basicValue, err := tags.NewTagValue(ctx, "basic_value", &tags.TagValueArgs{
// Description: pulumi.String("For valuename resources."),
// Parent: basicKey.Name.ApplyT(func(name string) (string, error) {
// return fmt.Sprintf("tagKeys/%v", name), nil
// }).(pulumi.StringOutput),
// ShortName: pulumi.String("tagvalue"),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewRegionNetworkFirewallPolicyRule(ctx, "primary", &compute.RegionNetworkFirewallPolicyRuleArgs{
// Action: pulumi.String("allow"),
// Description: pulumi.String("This is a simple rule description"),
// Direction: pulumi.String("INGRESS"),
// Disabled: pulumi.Bool(false),
// EnableLogging: pulumi.Bool(true),
// FirewallPolicy: basicRegionalNetworkFirewallPolicy.Name,
// Priority: pulumi.Int(1000),
// Region: pulumi.String("us-west1"),
// RuleName: pulumi.String("test-rule"),
// TargetServiceAccounts: pulumi.StringArray{
// pulumi.String("my@service-account.com"),
// },
// Match: &compute.RegionNetworkFirewallPolicyRuleMatchArgs{
// SrcIpRanges: pulumi.StringArray{
// pulumi.String("10.100.0.1/32"),
// },
// SrcFqdns: pulumi.StringArray{
// pulumi.String("example.com"),
// },
// SrcRegionCodes: pulumi.StringArray{
// pulumi.String("US"),
// },
// SrcThreatIntelligences: pulumi.StringArray{
// pulumi.String("iplist-known-malicious-ips"),
// },
// Layer4Configs: compute.RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArray{
// &compute.RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs{
// IpProtocol: pulumi.String("all"),
// },
// },
// SrcSecureTags: compute.RegionNetworkFirewallPolicyRuleMatchSrcSecureTagArray{
// &compute.RegionNetworkFirewallPolicyRuleMatchSrcSecureTagArgs{
// Name: basicValue.Name.ApplyT(func(name string) (string, error) {
// return fmt.Sprintf("tagValues/%v", name), nil
// }).(pulumi.StringOutput),
// },
// },
// SrcAddressGroups: pulumi.StringArray{
// basicRegionalNetworksecurityAddressGroup.ID(),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// NetworkFirewallPolicyRule can be imported using any of these accepted formats:
//
// * `projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/{{priority}}`
//
// * `{{project}}/{{region}}/{{firewall_policy}}/{{priority}}`
//
// * `{{region}}/{{firewall_policy}}/{{priority}}`
//
// * `{{firewall_policy}}/{{priority}}`
//
// When using the `pulumi import` command, NetworkFirewallPolicyRule can be imported using one of the formats above. For example:
//
// ```sh
// $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/{{priority}}
// ```
//
// ```sh
// $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{project}}/{{region}}/{{firewall_policy}}/{{priority}}
// ```
//
// ```sh
// $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{region}}/{{firewall_policy}}/{{priority}}
// ```
//
// ```sh
// $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{firewall_policy}}/{{priority}}
// ```
type RegionNetworkFirewallPolicyRule struct {
pulumi.CustomResourceState
// The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "gotoNext".
Action pulumi.StringOutput `pulumi:"action"`
// An optional description for this resource.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The direction in which this rule applies. Possible values: INGRESS, EGRESS
Direction pulumi.StringOutput `pulumi:"direction"`
// Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and
// traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
Disabled pulumi.BoolPtrOutput `pulumi:"disabled"`
// Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured
// export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on
// "goto_next" rules.
EnableLogging pulumi.BoolPtrOutput `pulumi:"enableLogging"`
// The firewall policy of the resource.
FirewallPolicy pulumi.StringOutput `pulumi:"firewallPolicy"`
// Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
Kind pulumi.StringOutput `pulumi:"kind"`
// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
Match RegionNetworkFirewallPolicyRuleMatchOutput `pulumi:"match"`
// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
Priority pulumi.IntOutput `pulumi:"priority"`
// The project for the resource
Project pulumi.StringOutput `pulumi:"project"`
// The location of this resource.
Region pulumi.StringOutput `pulumi:"region"`
// An optional name for the rule. This field is not a unique identifier and can be updated.
RuleName pulumi.StringPtrOutput `pulumi:"ruleName"`
// Calculation of the complexity of a single firewall policy rule.
RuleTupleCount pulumi.IntOutput `pulumi:"ruleTupleCount"`
// A list of secure tags that controls which instances the firewall rule applies to. If <code>targetSecureTag</code> are
// specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure
// tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored.
// <code>targetSecureTag</code> may not be set at the same time as <code>targetServiceAccounts</code>. If neither
// <code>targetServiceAccounts</code> nor <code>targetSecureTag</code> are specified, the firewall rule applies to all
// instances on the specified network. Maximum number of target label tags allowed is 256.
TargetSecureTags RegionNetworkFirewallPolicyRuleTargetSecureTagArrayOutput `pulumi:"targetSecureTags"`
// A list of service accounts indicating the sets of instances that are applied with this rule.
TargetServiceAccounts pulumi.StringArrayOutput `pulumi:"targetServiceAccounts"`
}
// NewRegionNetworkFirewallPolicyRule registers a new resource with the given unique name, arguments, and options.
func NewRegionNetworkFirewallPolicyRule(ctx *pulumi.Context,
name string, args *RegionNetworkFirewallPolicyRuleArgs, opts ...pulumi.ResourceOption) (*RegionNetworkFirewallPolicyRule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Action == nil {
return nil, errors.New("invalid value for required argument 'Action'")
}
if args.Direction == nil {
return nil, errors.New("invalid value for required argument 'Direction'")
}
if args.FirewallPolicy == nil {
return nil, errors.New("invalid value for required argument 'FirewallPolicy'")
}
if args.Match == nil {
return nil, errors.New("invalid value for required argument 'Match'")
}
if args.Priority == nil {
return nil, errors.New("invalid value for required argument 'Priority'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource RegionNetworkFirewallPolicyRule
err := ctx.RegisterResource("gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRegionNetworkFirewallPolicyRule gets an existing RegionNetworkFirewallPolicyRule 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 GetRegionNetworkFirewallPolicyRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RegionNetworkFirewallPolicyRuleState, opts ...pulumi.ResourceOption) (*RegionNetworkFirewallPolicyRule, error) {
var resource RegionNetworkFirewallPolicyRule
err := ctx.ReadResource("gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RegionNetworkFirewallPolicyRule resources.
type regionNetworkFirewallPolicyRuleState struct {
// The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "gotoNext".
Action *string `pulumi:"action"`
// An optional description for this resource.
Description *string `pulumi:"description"`
// The direction in which this rule applies. Possible values: INGRESS, EGRESS
Direction *string `pulumi:"direction"`
// Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and
// traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
Disabled *bool `pulumi:"disabled"`
// Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured
// export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on
// "goto_next" rules.
EnableLogging *bool `pulumi:"enableLogging"`
// The firewall policy of the resource.
FirewallPolicy *string `pulumi:"firewallPolicy"`
// Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
Kind *string `pulumi:"kind"`
// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
Match *RegionNetworkFirewallPolicyRuleMatch `pulumi:"match"`
// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
Priority *int `pulumi:"priority"`
// The project for the resource
Project *string `pulumi:"project"`
// The location of this resource.
Region *string `pulumi:"region"`
// An optional name for the rule. This field is not a unique identifier and can be updated.
RuleName *string `pulumi:"ruleName"`
// Calculation of the complexity of a single firewall policy rule.
RuleTupleCount *int `pulumi:"ruleTupleCount"`
// A list of secure tags that controls which instances the firewall rule applies to. If <code>targetSecureTag</code> are
// specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure
// tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored.
// <code>targetSecureTag</code> may not be set at the same time as <code>targetServiceAccounts</code>. If neither
// <code>targetServiceAccounts</code> nor <code>targetSecureTag</code> are specified, the firewall rule applies to all
// instances on the specified network. Maximum number of target label tags allowed is 256.
TargetSecureTags []RegionNetworkFirewallPolicyRuleTargetSecureTag `pulumi:"targetSecureTags"`
// A list of service accounts indicating the sets of instances that are applied with this rule.
TargetServiceAccounts []string `pulumi:"targetServiceAccounts"`
}
type RegionNetworkFirewallPolicyRuleState struct {
// The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "gotoNext".
Action pulumi.StringPtrInput
// An optional description for this resource.
Description pulumi.StringPtrInput
// The direction in which this rule applies. Possible values: INGRESS, EGRESS
Direction pulumi.StringPtrInput
// Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and
// traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
Disabled pulumi.BoolPtrInput
// Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured
// export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on
// "goto_next" rules.
EnableLogging pulumi.BoolPtrInput
// The firewall policy of the resource.
FirewallPolicy pulumi.StringPtrInput
// Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
Kind pulumi.StringPtrInput
// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
Match RegionNetworkFirewallPolicyRuleMatchPtrInput
// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
Priority pulumi.IntPtrInput
// The project for the resource
Project pulumi.StringPtrInput
// The location of this resource.
Region pulumi.StringPtrInput
// An optional name for the rule. This field is not a unique identifier and can be updated.
RuleName pulumi.StringPtrInput
// Calculation of the complexity of a single firewall policy rule.
RuleTupleCount pulumi.IntPtrInput
// A list of secure tags that controls which instances the firewall rule applies to. If <code>targetSecureTag</code> are
// specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure
// tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored.
// <code>targetSecureTag</code> may not be set at the same time as <code>targetServiceAccounts</code>. If neither
// <code>targetServiceAccounts</code> nor <code>targetSecureTag</code> are specified, the firewall rule applies to all
// instances on the specified network. Maximum number of target label tags allowed is 256.
TargetSecureTags RegionNetworkFirewallPolicyRuleTargetSecureTagArrayInput
// A list of service accounts indicating the sets of instances that are applied with this rule.
TargetServiceAccounts pulumi.StringArrayInput
}
func (RegionNetworkFirewallPolicyRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*regionNetworkFirewallPolicyRuleState)(nil)).Elem()
}
type regionNetworkFirewallPolicyRuleArgs struct {
// The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "gotoNext".
Action string `pulumi:"action"`
// An optional description for this resource.
Description *string `pulumi:"description"`
// The direction in which this rule applies. Possible values: INGRESS, EGRESS
Direction string `pulumi:"direction"`
// Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and
// traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
Disabled *bool `pulumi:"disabled"`
// Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured
// export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on
// "goto_next" rules.
EnableLogging *bool `pulumi:"enableLogging"`
// The firewall policy of the resource.
FirewallPolicy string `pulumi:"firewallPolicy"`
// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
Match RegionNetworkFirewallPolicyRuleMatch `pulumi:"match"`
// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
Priority int `pulumi:"priority"`
// The project for the resource
Project *string `pulumi:"project"`
// The location of this resource.
Region *string `pulumi:"region"`
// An optional name for the rule. This field is not a unique identifier and can be updated.
RuleName *string `pulumi:"ruleName"`
// A list of secure tags that controls which instances the firewall rule applies to. If <code>targetSecureTag</code> are
// specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure
// tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored.
// <code>targetSecureTag</code> may not be set at the same time as <code>targetServiceAccounts</code>. If neither
// <code>targetServiceAccounts</code> nor <code>targetSecureTag</code> are specified, the firewall rule applies to all
// instances on the specified network. Maximum number of target label tags allowed is 256.
TargetSecureTags []RegionNetworkFirewallPolicyRuleTargetSecureTag `pulumi:"targetSecureTags"`
// A list of service accounts indicating the sets of instances that are applied with this rule.
TargetServiceAccounts []string `pulumi:"targetServiceAccounts"`
}
// The set of arguments for constructing a RegionNetworkFirewallPolicyRule resource.
type RegionNetworkFirewallPolicyRuleArgs struct {
// The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "gotoNext".
Action pulumi.StringInput
// An optional description for this resource.
Description pulumi.StringPtrInput
// The direction in which this rule applies. Possible values: INGRESS, EGRESS
Direction pulumi.StringInput
// Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and
// traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
Disabled pulumi.BoolPtrInput
// Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured
// export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on
// "goto_next" rules.
EnableLogging pulumi.BoolPtrInput
// The firewall policy of the resource.
FirewallPolicy pulumi.StringInput
// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
Match RegionNetworkFirewallPolicyRuleMatchInput
// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
Priority pulumi.IntInput
// The project for the resource
Project pulumi.StringPtrInput
// The location of this resource.
Region pulumi.StringPtrInput
// An optional name for the rule. This field is not a unique identifier and can be updated.
RuleName pulumi.StringPtrInput
// A list of secure tags that controls which instances the firewall rule applies to. If <code>targetSecureTag</code> are
// specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure
// tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored.
// <code>targetSecureTag</code> may not be set at the same time as <code>targetServiceAccounts</code>. If neither
// <code>targetServiceAccounts</code> nor <code>targetSecureTag</code> are specified, the firewall rule applies to all
// instances on the specified network. Maximum number of target label tags allowed is 256.
TargetSecureTags RegionNetworkFirewallPolicyRuleTargetSecureTagArrayInput
// A list of service accounts indicating the sets of instances that are applied with this rule.
TargetServiceAccounts pulumi.StringArrayInput
}
func (RegionNetworkFirewallPolicyRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*regionNetworkFirewallPolicyRuleArgs)(nil)).Elem()
}
type RegionNetworkFirewallPolicyRuleInput interface {
pulumi.Input
ToRegionNetworkFirewallPolicyRuleOutput() RegionNetworkFirewallPolicyRuleOutput
ToRegionNetworkFirewallPolicyRuleOutputWithContext(ctx context.Context) RegionNetworkFirewallPolicyRuleOutput
}
func (*RegionNetworkFirewallPolicyRule) ElementType() reflect.Type {
return reflect.TypeOf((**RegionNetworkFirewallPolicyRule)(nil)).Elem()
}
func (i *RegionNetworkFirewallPolicyRule) ToRegionNetworkFirewallPolicyRuleOutput() RegionNetworkFirewallPolicyRuleOutput {
return i.ToRegionNetworkFirewallPolicyRuleOutputWithContext(context.Background())
}
func (i *RegionNetworkFirewallPolicyRule) ToRegionNetworkFirewallPolicyRuleOutputWithContext(ctx context.Context) RegionNetworkFirewallPolicyRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegionNetworkFirewallPolicyRuleOutput)
}
// RegionNetworkFirewallPolicyRuleArrayInput is an input type that accepts RegionNetworkFirewallPolicyRuleArray and RegionNetworkFirewallPolicyRuleArrayOutput values.
// You can construct a concrete instance of `RegionNetworkFirewallPolicyRuleArrayInput` via:
//
// RegionNetworkFirewallPolicyRuleArray{ RegionNetworkFirewallPolicyRuleArgs{...} }
type RegionNetworkFirewallPolicyRuleArrayInput interface {
pulumi.Input
ToRegionNetworkFirewallPolicyRuleArrayOutput() RegionNetworkFirewallPolicyRuleArrayOutput
ToRegionNetworkFirewallPolicyRuleArrayOutputWithContext(context.Context) RegionNetworkFirewallPolicyRuleArrayOutput
}
type RegionNetworkFirewallPolicyRuleArray []RegionNetworkFirewallPolicyRuleInput
func (RegionNetworkFirewallPolicyRuleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RegionNetworkFirewallPolicyRule)(nil)).Elem()
}
func (i RegionNetworkFirewallPolicyRuleArray) ToRegionNetworkFirewallPolicyRuleArrayOutput() RegionNetworkFirewallPolicyRuleArrayOutput {
return i.ToRegionNetworkFirewallPolicyRuleArrayOutputWithContext(context.Background())
}
func (i RegionNetworkFirewallPolicyRuleArray) ToRegionNetworkFirewallPolicyRuleArrayOutputWithContext(ctx context.Context) RegionNetworkFirewallPolicyRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegionNetworkFirewallPolicyRuleArrayOutput)
}
// RegionNetworkFirewallPolicyRuleMapInput is an input type that accepts RegionNetworkFirewallPolicyRuleMap and RegionNetworkFirewallPolicyRuleMapOutput values.
// You can construct a concrete instance of `RegionNetworkFirewallPolicyRuleMapInput` via:
//
// RegionNetworkFirewallPolicyRuleMap{ "key": RegionNetworkFirewallPolicyRuleArgs{...} }
type RegionNetworkFirewallPolicyRuleMapInput interface {
pulumi.Input
ToRegionNetworkFirewallPolicyRuleMapOutput() RegionNetworkFirewallPolicyRuleMapOutput
ToRegionNetworkFirewallPolicyRuleMapOutputWithContext(context.Context) RegionNetworkFirewallPolicyRuleMapOutput
}
type RegionNetworkFirewallPolicyRuleMap map[string]RegionNetworkFirewallPolicyRuleInput
func (RegionNetworkFirewallPolicyRuleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RegionNetworkFirewallPolicyRule)(nil)).Elem()
}
func (i RegionNetworkFirewallPolicyRuleMap) ToRegionNetworkFirewallPolicyRuleMapOutput() RegionNetworkFirewallPolicyRuleMapOutput {
return i.ToRegionNetworkFirewallPolicyRuleMapOutputWithContext(context.Background())
}
func (i RegionNetworkFirewallPolicyRuleMap) ToRegionNetworkFirewallPolicyRuleMapOutputWithContext(ctx context.Context) RegionNetworkFirewallPolicyRuleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegionNetworkFirewallPolicyRuleMapOutput)
}
type RegionNetworkFirewallPolicyRuleOutput struct{ *pulumi.OutputState }
func (RegionNetworkFirewallPolicyRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RegionNetworkFirewallPolicyRule)(nil)).Elem()
}
func (o RegionNetworkFirewallPolicyRuleOutput) ToRegionNetworkFirewallPolicyRuleOutput() RegionNetworkFirewallPolicyRuleOutput {
return o
}
func (o RegionNetworkFirewallPolicyRuleOutput) ToRegionNetworkFirewallPolicyRuleOutputWithContext(ctx context.Context) RegionNetworkFirewallPolicyRuleOutput {
return o
}
// The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "gotoNext".
func (o RegionNetworkFirewallPolicyRuleOutput) Action() pulumi.StringOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringOutput { return v.Action }).(pulumi.StringOutput)
}
// An optional description for this resource.
func (o RegionNetworkFirewallPolicyRuleOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The direction in which this rule applies. Possible values: INGRESS, EGRESS
func (o RegionNetworkFirewallPolicyRuleOutput) Direction() pulumi.StringOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringOutput { return v.Direction }).(pulumi.StringOutput)
}
// Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and
// traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
func (o RegionNetworkFirewallPolicyRuleOutput) Disabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.BoolPtrOutput { return v.Disabled }).(pulumi.BoolPtrOutput)
}
// Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured
// export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on
// "goto_next" rules.
func (o RegionNetworkFirewallPolicyRuleOutput) EnableLogging() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.BoolPtrOutput { return v.EnableLogging }).(pulumi.BoolPtrOutput)
}
// The firewall policy of the resource.
func (o RegionNetworkFirewallPolicyRuleOutput) FirewallPolicy() pulumi.StringOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringOutput { return v.FirewallPolicy }).(pulumi.StringOutput)
}
// Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
func (o RegionNetworkFirewallPolicyRuleOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringOutput { return v.Kind }).(pulumi.StringOutput)
}
// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
func (o RegionNetworkFirewallPolicyRuleOutput) Match() RegionNetworkFirewallPolicyRuleMatchOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) RegionNetworkFirewallPolicyRuleMatchOutput { return v.Match }).(RegionNetworkFirewallPolicyRuleMatchOutput)
}
// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
func (o RegionNetworkFirewallPolicyRuleOutput) Priority() pulumi.IntOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.IntOutput { return v.Priority }).(pulumi.IntOutput)
}
// The project for the resource
func (o RegionNetworkFirewallPolicyRuleOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The location of this resource.
func (o RegionNetworkFirewallPolicyRuleOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// An optional name for the rule. This field is not a unique identifier and can be updated.
func (o RegionNetworkFirewallPolicyRuleOutput) RuleName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringPtrOutput { return v.RuleName }).(pulumi.StringPtrOutput)
}
// Calculation of the complexity of a single firewall policy rule.
func (o RegionNetworkFirewallPolicyRuleOutput) RuleTupleCount() pulumi.IntOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.IntOutput { return v.RuleTupleCount }).(pulumi.IntOutput)
}
// A list of secure tags that controls which instances the firewall rule applies to. If <code>targetSecureTag</code> are
// specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure
// tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored.
// <code>targetSecureTag</code> may not be set at the same time as <code>targetServiceAccounts</code>. If neither
// <code>targetServiceAccounts</code> nor <code>targetSecureTag</code> are specified, the firewall rule applies to all
// instances on the specified network. Maximum number of target label tags allowed is 256.
func (o RegionNetworkFirewallPolicyRuleOutput) TargetSecureTags() RegionNetworkFirewallPolicyRuleTargetSecureTagArrayOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) RegionNetworkFirewallPolicyRuleTargetSecureTagArrayOutput {
return v.TargetSecureTags
}).(RegionNetworkFirewallPolicyRuleTargetSecureTagArrayOutput)
}
// A list of service accounts indicating the sets of instances that are applied with this rule.
func (o RegionNetworkFirewallPolicyRuleOutput) TargetServiceAccounts() pulumi.StringArrayOutput {
return o.ApplyT(func(v *RegionNetworkFirewallPolicyRule) pulumi.StringArrayOutput { return v.TargetServiceAccounts }).(pulumi.StringArrayOutput)
}
type RegionNetworkFirewallPolicyRuleArrayOutput struct{ *pulumi.OutputState }
func (RegionNetworkFirewallPolicyRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RegionNetworkFirewallPolicyRule)(nil)).Elem()
}
func (o RegionNetworkFirewallPolicyRuleArrayOutput) ToRegionNetworkFirewallPolicyRuleArrayOutput() RegionNetworkFirewallPolicyRuleArrayOutput {
return o
}
func (o RegionNetworkFirewallPolicyRuleArrayOutput) ToRegionNetworkFirewallPolicyRuleArrayOutputWithContext(ctx context.Context) RegionNetworkFirewallPolicyRuleArrayOutput {
return o
}
func (o RegionNetworkFirewallPolicyRuleArrayOutput) Index(i pulumi.IntInput) RegionNetworkFirewallPolicyRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RegionNetworkFirewallPolicyRule {
return vs[0].([]*RegionNetworkFirewallPolicyRule)[vs[1].(int)]
}).(RegionNetworkFirewallPolicyRuleOutput)
}
type RegionNetworkFirewallPolicyRuleMapOutput struct{ *pulumi.OutputState }
func (RegionNetworkFirewallPolicyRuleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RegionNetworkFirewallPolicyRule)(nil)).Elem()
}
func (o RegionNetworkFirewallPolicyRuleMapOutput) ToRegionNetworkFirewallPolicyRuleMapOutput() RegionNetworkFirewallPolicyRuleMapOutput {
return o
}
func (o RegionNetworkFirewallPolicyRuleMapOutput) ToRegionNetworkFirewallPolicyRuleMapOutputWithContext(ctx context.Context) RegionNetworkFirewallPolicyRuleMapOutput {
return o
}
func (o RegionNetworkFirewallPolicyRuleMapOutput) MapIndex(k pulumi.StringInput) RegionNetworkFirewallPolicyRuleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RegionNetworkFirewallPolicyRule {
return vs[0].(map[string]*RegionNetworkFirewallPolicyRule)[vs[1].(string)]
}).(RegionNetworkFirewallPolicyRuleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RegionNetworkFirewallPolicyRuleInput)(nil)).Elem(), &RegionNetworkFirewallPolicyRule{})
pulumi.RegisterInputType(reflect.TypeOf((*RegionNetworkFirewallPolicyRuleArrayInput)(nil)).Elem(), RegionNetworkFirewallPolicyRuleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RegionNetworkFirewallPolicyRuleMapInput)(nil)).Elem(), RegionNetworkFirewallPolicyRuleMap{})
pulumi.RegisterOutputType(RegionNetworkFirewallPolicyRuleOutput{})
pulumi.RegisterOutputType(RegionNetworkFirewallPolicyRuleArrayOutput{})
pulumi.RegisterOutputType(RegionNetworkFirewallPolicyRuleMapOutput{})
}