-
Notifications
You must be signed in to change notification settings - Fork 151
/
securityGroupRule.go
477 lines (417 loc) · 20.4 KB
/
securityGroupRule.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a security group rule resource. Represents a single `ingress` or
// `egress` group rule, which can be added to external Security Groups.
//
// > **NOTE on Security Groups and Security Group Rules:** This provider currently
// provides both a standalone Security Group Rule resource (a single `ingress` or
// `egress` rule), and a Security Group resource with `ingress` and `egress` rules
// defined in-line. At this time you cannot use a Security Group with in-line rules
// in conjunction with any Security Group Rule resources. Doing so will cause
// a conflict of rule settings and will overwrite rules.
//
// > **NOTE:** Setting `protocol = "all"` or `protocol = -1` with `fromPort` and `toPort` will result in the EC2 API creating a security group rule with all ports open. This API behavior cannot be controlled by this provider and may generate warnings in the future.
//
// > **NOTE:** Referencing Security Groups across VPC peering has certain restrictions. More information is available in the [VPC Peering User Guide](https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-security-groups.html).
//
// ## Example Usage
// ### Usage With Prefix List IDs
//
// Prefix Lists are either managed by AWS internally, or created by the customer using a
// Managed Prefix List resource. Prefix Lists provided by
// AWS are associated with a prefix list name, or service name, that is linked to a specific region.
//
// Prefix list IDs are exported on VPC Endpoints, so you can use this format:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// myEndpoint, err := ec2.NewVpcEndpoint(ctx, "myEndpoint", nil)
// if err != nil {
// return err
// }
// _, err = ec2.NewSecurityGroupRule(ctx, "allowAll", &ec2.SecurityGroupRuleArgs{
// Type: pulumi.String("egress"),
// ToPort: pulumi.Int(0),
// Protocol: pulumi.String("-1"),
// PrefixListIds: pulumi.StringArray{
// myEndpoint.PrefixListId,
// },
// FromPort: pulumi.Int(0),
// SecurityGroupId: pulumi.String("sg-123456"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// You can also find a specific Prefix List using the `ec2.getPrefixList` data source.
//
// ## Import
//
// Security Group Rules can be imported using the `security_group_id`, `type`, `protocol`, `from_port`, `to_port`, and source(s)/destination(s) (e.g. `cidr_block`) separated by underscores (`_`). All parts are required. Not all rule permissions (e.g., not all of a rule's CIDR blocks) need to be imported for this provider to manage rule permissions. However, importing some of a rule's permissions but not others, and then making changes to the rule will result in the creation of an additional rule to capture the updated permissions. Rule permissions that were not imported are left intact in the original rule. Import an ingress rule in security group `sg-6e616f6d69` for TCP port 8000 with an IPv4 destination CIDR of `10.0.3.0/24`console
//
// ```sh
// $ pulumi import aws:ec2/securityGroupRule:SecurityGroupRule ingress sg-6e616f6d69_ingress_tcp_8000_8000_10.0.3.0/24
// ```
//
// Import a rule with various IPv4 and IPv6 source CIDR blocksconsole
//
// ```sh
// $ pulumi import aws:ec2/securityGroupRule:SecurityGroupRule ingress sg-4973616163_ingress_tcp_100_121_10.1.0.0/16_2001:db8::/48_10.2.0.0/16_2002:db8::/48
// ```
//
// Import a rule, applicable to all ports, with a protocol other than TCP/UDP/ICMP/ALL, e.g., Multicast Transport Protocol (MTP), using the IANA protocol number, e.g., 92. console
//
// ```sh
// $ pulumi import aws:ec2/securityGroupRule:SecurityGroupRule ingress sg-6777656e646f6c796e_ingress_92_0_65536_10.0.3.0/24_10.0.4.0/24
// ```
//
// Import an egress rule with a prefix list ID destinationconsole
//
// ```sh
// $ pulumi import aws:ec2/securityGroupRule:SecurityGroupRule egress sg-62726f6479_egress_tcp_8000_8000_pl-6469726b
// ```
//
// Import a rule applicable to all protocols and ports with a security group sourceconsole
//
// ```sh
// $ pulumi import aws:ec2/securityGroupRule:SecurityGroupRule ingress_rule sg-7472697374616e_ingress_all_0_65536_sg-6176657279
// ```
//
// Import a rule that has itself and an IPv6 CIDR block as sourcesconsole
//
// ```sh
// $ pulumi import aws:ec2/securityGroupRule:SecurityGroupRule rule_name sg-656c65616e6f72_ingress_tcp_80_80_self_2001:db8::/48
// ```
type SecurityGroupRule struct {
pulumi.CustomResourceState
// List of CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
CidrBlocks pulumi.StringArrayOutput `pulumi:"cidrBlocks"`
// Description of the rule.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Start port (or ICMP type number if protocol is "icmp" or "icmpv6").
FromPort pulumi.IntOutput `pulumi:"fromPort"`
// List of IPv6 CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
Ipv6CidrBlocks pulumi.StringArrayOutput `pulumi:"ipv6CidrBlocks"`
// List of Prefix List IDs.
PrefixListIds pulumi.StringArrayOutput `pulumi:"prefixListIds"`
// Protocol. If not icmp, icmpv6, tcp, udp, or all use the [protocol number](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)
Protocol pulumi.StringOutput `pulumi:"protocol"`
// Security group to apply this rule to.
SecurityGroupId pulumi.StringOutput `pulumi:"securityGroupId"`
// Whether the security group itself will be added as a source to this ingress rule. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `sourceSecurityGroupId`.
Self pulumi.BoolPtrOutput `pulumi:"self"`
// Security group id to allow access to/from, depending on the `type`. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `self`.
SourceSecurityGroupId pulumi.StringOutput `pulumi:"sourceSecurityGroupId"`
// End port (or ICMP code if protocol is "icmp").
ToPort pulumi.IntOutput `pulumi:"toPort"`
// Type of rule being created. Valid options are `ingress` (inbound)
// or `egress` (outbound).
Type pulumi.StringOutput `pulumi:"type"`
}
// NewSecurityGroupRule registers a new resource with the given unique name, arguments, and options.
func NewSecurityGroupRule(ctx *pulumi.Context,
name string, args *SecurityGroupRuleArgs, opts ...pulumi.ResourceOption) (*SecurityGroupRule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FromPort == nil {
return nil, errors.New("invalid value for required argument 'FromPort'")
}
if args.Protocol == nil {
return nil, errors.New("invalid value for required argument 'Protocol'")
}
if args.SecurityGroupId == nil {
return nil, errors.New("invalid value for required argument 'SecurityGroupId'")
}
if args.ToPort == nil {
return nil, errors.New("invalid value for required argument 'ToPort'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
var resource SecurityGroupRule
err := ctx.RegisterResource("aws:ec2/securityGroupRule:SecurityGroupRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSecurityGroupRule gets an existing SecurityGroupRule 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 GetSecurityGroupRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SecurityGroupRuleState, opts ...pulumi.ResourceOption) (*SecurityGroupRule, error) {
var resource SecurityGroupRule
err := ctx.ReadResource("aws:ec2/securityGroupRule:SecurityGroupRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SecurityGroupRule resources.
type securityGroupRuleState struct {
// List of CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
CidrBlocks []string `pulumi:"cidrBlocks"`
// Description of the rule.
Description *string `pulumi:"description"`
// Start port (or ICMP type number if protocol is "icmp" or "icmpv6").
FromPort *int `pulumi:"fromPort"`
// List of IPv6 CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
Ipv6CidrBlocks []string `pulumi:"ipv6CidrBlocks"`
// List of Prefix List IDs.
PrefixListIds []string `pulumi:"prefixListIds"`
// Protocol. If not icmp, icmpv6, tcp, udp, or all use the [protocol number](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)
Protocol *string `pulumi:"protocol"`
// Security group to apply this rule to.
SecurityGroupId *string `pulumi:"securityGroupId"`
// Whether the security group itself will be added as a source to this ingress rule. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `sourceSecurityGroupId`.
Self *bool `pulumi:"self"`
// Security group id to allow access to/from, depending on the `type`. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `self`.
SourceSecurityGroupId *string `pulumi:"sourceSecurityGroupId"`
// End port (or ICMP code if protocol is "icmp").
ToPort *int `pulumi:"toPort"`
// Type of rule being created. Valid options are `ingress` (inbound)
// or `egress` (outbound).
Type *string `pulumi:"type"`
}
type SecurityGroupRuleState struct {
// List of CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
CidrBlocks pulumi.StringArrayInput
// Description of the rule.
Description pulumi.StringPtrInput
// Start port (or ICMP type number if protocol is "icmp" or "icmpv6").
FromPort pulumi.IntPtrInput
// List of IPv6 CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
Ipv6CidrBlocks pulumi.StringArrayInput
// List of Prefix List IDs.
PrefixListIds pulumi.StringArrayInput
// Protocol. If not icmp, icmpv6, tcp, udp, or all use the [protocol number](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)
Protocol pulumi.StringPtrInput
// Security group to apply this rule to.
SecurityGroupId pulumi.StringPtrInput
// Whether the security group itself will be added as a source to this ingress rule. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `sourceSecurityGroupId`.
Self pulumi.BoolPtrInput
// Security group id to allow access to/from, depending on the `type`. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `self`.
SourceSecurityGroupId pulumi.StringPtrInput
// End port (or ICMP code if protocol is "icmp").
ToPort pulumi.IntPtrInput
// Type of rule being created. Valid options are `ingress` (inbound)
// or `egress` (outbound).
Type pulumi.StringPtrInput
}
func (SecurityGroupRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*securityGroupRuleState)(nil)).Elem()
}
type securityGroupRuleArgs struct {
// List of CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
CidrBlocks []string `pulumi:"cidrBlocks"`
// Description of the rule.
Description *string `pulumi:"description"`
// Start port (or ICMP type number if protocol is "icmp" or "icmpv6").
FromPort int `pulumi:"fromPort"`
// List of IPv6 CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
Ipv6CidrBlocks []string `pulumi:"ipv6CidrBlocks"`
// List of Prefix List IDs.
PrefixListIds []string `pulumi:"prefixListIds"`
// Protocol. If not icmp, icmpv6, tcp, udp, or all use the [protocol number](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)
Protocol string `pulumi:"protocol"`
// Security group to apply this rule to.
SecurityGroupId string `pulumi:"securityGroupId"`
// Whether the security group itself will be added as a source to this ingress rule. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `sourceSecurityGroupId`.
Self *bool `pulumi:"self"`
// Security group id to allow access to/from, depending on the `type`. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `self`.
SourceSecurityGroupId *string `pulumi:"sourceSecurityGroupId"`
// End port (or ICMP code if protocol is "icmp").
ToPort int `pulumi:"toPort"`
// Type of rule being created. Valid options are `ingress` (inbound)
// or `egress` (outbound).
Type string `pulumi:"type"`
}
// The set of arguments for constructing a SecurityGroupRule resource.
type SecurityGroupRuleArgs struct {
// List of CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
CidrBlocks pulumi.StringArrayInput
// Description of the rule.
Description pulumi.StringPtrInput
// Start port (or ICMP type number if protocol is "icmp" or "icmpv6").
FromPort pulumi.IntInput
// List of IPv6 CIDR blocks. Cannot be specified with `sourceSecurityGroupId` or `self`.
Ipv6CidrBlocks pulumi.StringArrayInput
// List of Prefix List IDs.
PrefixListIds pulumi.StringArrayInput
// Protocol. If not icmp, icmpv6, tcp, udp, or all use the [protocol number](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)
Protocol pulumi.StringInput
// Security group to apply this rule to.
SecurityGroupId pulumi.StringInput
// Whether the security group itself will be added as a source to this ingress rule. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `sourceSecurityGroupId`.
Self pulumi.BoolPtrInput
// Security group id to allow access to/from, depending on the `type`. Cannot be specified with `cidrBlocks`, `ipv6CidrBlocks`, or `self`.
SourceSecurityGroupId pulumi.StringPtrInput
// End port (or ICMP code if protocol is "icmp").
ToPort pulumi.IntInput
// Type of rule being created. Valid options are `ingress` (inbound)
// or `egress` (outbound).
Type pulumi.StringInput
}
func (SecurityGroupRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*securityGroupRuleArgs)(nil)).Elem()
}
type SecurityGroupRuleInput interface {
pulumi.Input
ToSecurityGroupRuleOutput() SecurityGroupRuleOutput
ToSecurityGroupRuleOutputWithContext(ctx context.Context) SecurityGroupRuleOutput
}
func (*SecurityGroupRule) ElementType() reflect.Type {
return reflect.TypeOf((*SecurityGroupRule)(nil))
}
func (i *SecurityGroupRule) ToSecurityGroupRuleOutput() SecurityGroupRuleOutput {
return i.ToSecurityGroupRuleOutputWithContext(context.Background())
}
func (i *SecurityGroupRule) ToSecurityGroupRuleOutputWithContext(ctx context.Context) SecurityGroupRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupRuleOutput)
}
func (i *SecurityGroupRule) ToSecurityGroupRulePtrOutput() SecurityGroupRulePtrOutput {
return i.ToSecurityGroupRulePtrOutputWithContext(context.Background())
}
func (i *SecurityGroupRule) ToSecurityGroupRulePtrOutputWithContext(ctx context.Context) SecurityGroupRulePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupRulePtrOutput)
}
type SecurityGroupRulePtrInput interface {
pulumi.Input
ToSecurityGroupRulePtrOutput() SecurityGroupRulePtrOutput
ToSecurityGroupRulePtrOutputWithContext(ctx context.Context) SecurityGroupRulePtrOutput
}
type securityGroupRulePtrType SecurityGroupRuleArgs
func (*securityGroupRulePtrType) ElementType() reflect.Type {
return reflect.TypeOf((**SecurityGroupRule)(nil))
}
func (i *securityGroupRulePtrType) ToSecurityGroupRulePtrOutput() SecurityGroupRulePtrOutput {
return i.ToSecurityGroupRulePtrOutputWithContext(context.Background())
}
func (i *securityGroupRulePtrType) ToSecurityGroupRulePtrOutputWithContext(ctx context.Context) SecurityGroupRulePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupRulePtrOutput)
}
// SecurityGroupRuleArrayInput is an input type that accepts SecurityGroupRuleArray and SecurityGroupRuleArrayOutput values.
// You can construct a concrete instance of `SecurityGroupRuleArrayInput` via:
//
// SecurityGroupRuleArray{ SecurityGroupRuleArgs{...} }
type SecurityGroupRuleArrayInput interface {
pulumi.Input
ToSecurityGroupRuleArrayOutput() SecurityGroupRuleArrayOutput
ToSecurityGroupRuleArrayOutputWithContext(context.Context) SecurityGroupRuleArrayOutput
}
type SecurityGroupRuleArray []SecurityGroupRuleInput
func (SecurityGroupRuleArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*SecurityGroupRule)(nil))
}
func (i SecurityGroupRuleArray) ToSecurityGroupRuleArrayOutput() SecurityGroupRuleArrayOutput {
return i.ToSecurityGroupRuleArrayOutputWithContext(context.Background())
}
func (i SecurityGroupRuleArray) ToSecurityGroupRuleArrayOutputWithContext(ctx context.Context) SecurityGroupRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupRuleArrayOutput)
}
// SecurityGroupRuleMapInput is an input type that accepts SecurityGroupRuleMap and SecurityGroupRuleMapOutput values.
// You can construct a concrete instance of `SecurityGroupRuleMapInput` via:
//
// SecurityGroupRuleMap{ "key": SecurityGroupRuleArgs{...} }
type SecurityGroupRuleMapInput interface {
pulumi.Input
ToSecurityGroupRuleMapOutput() SecurityGroupRuleMapOutput
ToSecurityGroupRuleMapOutputWithContext(context.Context) SecurityGroupRuleMapOutput
}
type SecurityGroupRuleMap map[string]SecurityGroupRuleInput
func (SecurityGroupRuleMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*SecurityGroupRule)(nil))
}
func (i SecurityGroupRuleMap) ToSecurityGroupRuleMapOutput() SecurityGroupRuleMapOutput {
return i.ToSecurityGroupRuleMapOutputWithContext(context.Background())
}
func (i SecurityGroupRuleMap) ToSecurityGroupRuleMapOutputWithContext(ctx context.Context) SecurityGroupRuleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupRuleMapOutput)
}
type SecurityGroupRuleOutput struct {
*pulumi.OutputState
}
func (SecurityGroupRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((*SecurityGroupRule)(nil))
}
func (o SecurityGroupRuleOutput) ToSecurityGroupRuleOutput() SecurityGroupRuleOutput {
return o
}
func (o SecurityGroupRuleOutput) ToSecurityGroupRuleOutputWithContext(ctx context.Context) SecurityGroupRuleOutput {
return o
}
func (o SecurityGroupRuleOutput) ToSecurityGroupRulePtrOutput() SecurityGroupRulePtrOutput {
return o.ToSecurityGroupRulePtrOutputWithContext(context.Background())
}
func (o SecurityGroupRuleOutput) ToSecurityGroupRulePtrOutputWithContext(ctx context.Context) SecurityGroupRulePtrOutput {
return o.ApplyT(func(v SecurityGroupRule) *SecurityGroupRule {
return &v
}).(SecurityGroupRulePtrOutput)
}
type SecurityGroupRulePtrOutput struct {
*pulumi.OutputState
}
func (SecurityGroupRulePtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SecurityGroupRule)(nil))
}
func (o SecurityGroupRulePtrOutput) ToSecurityGroupRulePtrOutput() SecurityGroupRulePtrOutput {
return o
}
func (o SecurityGroupRulePtrOutput) ToSecurityGroupRulePtrOutputWithContext(ctx context.Context) SecurityGroupRulePtrOutput {
return o
}
type SecurityGroupRuleArrayOutput struct{ *pulumi.OutputState }
func (SecurityGroupRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]SecurityGroupRule)(nil))
}
func (o SecurityGroupRuleArrayOutput) ToSecurityGroupRuleArrayOutput() SecurityGroupRuleArrayOutput {
return o
}
func (o SecurityGroupRuleArrayOutput) ToSecurityGroupRuleArrayOutputWithContext(ctx context.Context) SecurityGroupRuleArrayOutput {
return o
}
func (o SecurityGroupRuleArrayOutput) Index(i pulumi.IntInput) SecurityGroupRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) SecurityGroupRule {
return vs[0].([]SecurityGroupRule)[vs[1].(int)]
}).(SecurityGroupRuleOutput)
}
type SecurityGroupRuleMapOutput struct{ *pulumi.OutputState }
func (SecurityGroupRuleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]SecurityGroupRule)(nil))
}
func (o SecurityGroupRuleMapOutput) ToSecurityGroupRuleMapOutput() SecurityGroupRuleMapOutput {
return o
}
func (o SecurityGroupRuleMapOutput) ToSecurityGroupRuleMapOutputWithContext(ctx context.Context) SecurityGroupRuleMapOutput {
return o
}
func (o SecurityGroupRuleMapOutput) MapIndex(k pulumi.StringInput) SecurityGroupRuleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) SecurityGroupRule {
return vs[0].(map[string]SecurityGroupRule)[vs[1].(string)]
}).(SecurityGroupRuleOutput)
}
func init() {
pulumi.RegisterOutputType(SecurityGroupRuleOutput{})
pulumi.RegisterOutputType(SecurityGroupRulePtrOutput{})
pulumi.RegisterOutputType(SecurityGroupRuleArrayOutput{})
pulumi.RegisterOutputType(SecurityGroupRuleMapOutput{})
}