github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpc/securityGroupIngressRule.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package vpc
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Manages an inbound (ingress) rule for a security group.
    16  //
    17  // When specifying an inbound rule for your security group in a VPC, the configuration must include a source for the traffic.
    18  //
    19  // > **NOTE on Security Groups and Security Group Rules:** this provider currently provides a Security Group resource with `ingress` and `egress` rules defined in-line and a Security Group Rule resource which manages one or more `ingress` or
    20  // `egress` rules. Both of these resource were added before AWS assigned a [security group rule unique ID](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html), and they do not work well in all scenarios using the`description` and `tags` attributes, which rely on the unique ID.
    21  // The `vpc.SecurityGroupIngressRule` resource has been added to address these limitations and should be used for all new security group rules.
    22  // You should not use the `vpc.SecurityGroupIngressRule` resource in conjunction with an `ec2.SecurityGroup` resource with in-line rules or with `ec2.SecurityGroupRule` resources defined for the same Security Group, as rule conflicts may occur and rules will be overwritten.
    23  //
    24  // ## Example Usage
    25  //
    26  // <!--Start PulumiCodeChooser -->
    27  // ```go
    28  // package main
    29  //
    30  // import (
    31  //
    32  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    33  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpc"
    34  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    35  //
    36  // )
    37  //
    38  //	func main() {
    39  //		pulumi.Run(func(ctx *pulumi.Context) error {
    40  //			example, err := ec2.NewSecurityGroup(ctx, "example", &ec2.SecurityGroupArgs{
    41  //				Name:        pulumi.String("example"),
    42  //				Description: pulumi.String("example"),
    43  //				VpcId:       pulumi.Any(main.Id),
    44  //				Tags: pulumi.StringMap{
    45  //					"Name": pulumi.String("example"),
    46  //				},
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			_, err = vpc.NewSecurityGroupIngressRule(ctx, "example", &vpc.SecurityGroupIngressRuleArgs{
    52  //				SecurityGroupId: example.ID(),
    53  //				CidrIpv4:        pulumi.String("10.0.0.0/8"),
    54  //				FromPort:        pulumi.Int(80),
    55  //				IpProtocol:      pulumi.String("tcp"),
    56  //				ToPort:          pulumi.Int(80),
    57  //			})
    58  //			if err != nil {
    59  //				return err
    60  //			}
    61  //			return nil
    62  //		})
    63  //	}
    64  //
    65  // ```
    66  // <!--End PulumiCodeChooser -->
    67  //
    68  // ## Import
    69  //
    70  // Using `pulumi import`, import security group ingress rules using the `security_group_rule_id`. For example:
    71  //
    72  // ```sh
    73  // $ pulumi import aws:vpc/securityGroupIngressRule:SecurityGroupIngressRule example sgr-02108b27edd666983
    74  // ```
    75  type SecurityGroupIngressRule struct {
    76  	pulumi.CustomResourceState
    77  
    78  	// The Amazon Resource Name (ARN) of the security group rule.
    79  	Arn pulumi.StringOutput `pulumi:"arn"`
    80  	// The source IPv4 CIDR range.
    81  	CidrIpv4 pulumi.StringPtrOutput `pulumi:"cidrIpv4"`
    82  	// The source IPv6 CIDR range.
    83  	CidrIpv6 pulumi.StringPtrOutput `pulumi:"cidrIpv6"`
    84  	// The security group rule description.
    85  	Description pulumi.StringPtrOutput `pulumi:"description"`
    86  	// The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
    87  	FromPort pulumi.IntPtrOutput `pulumi:"fromPort"`
    88  	// The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ipProtocol` is set to `-1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined.
    89  	IpProtocol pulumi.StringOutput `pulumi:"ipProtocol"`
    90  	// The ID of the source prefix list.
    91  	PrefixListId pulumi.StringPtrOutput `pulumi:"prefixListId"`
    92  	// The source security group that is referenced in the rule.
    93  	ReferencedSecurityGroupId pulumi.StringPtrOutput `pulumi:"referencedSecurityGroupId"`
    94  	// The ID of the security group.
    95  	SecurityGroupId pulumi.StringOutput `pulumi:"securityGroupId"`
    96  	// The ID of the security group rule.
    97  	SecurityGroupRuleId pulumi.StringOutput `pulumi:"securityGroupRuleId"`
    98  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    99  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   100  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   101  	//
   102  	// Deprecated: Please use `tags` instead.
   103  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   104  	// The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
   105  	ToPort pulumi.IntPtrOutput `pulumi:"toPort"`
   106  }
   107  
   108  // NewSecurityGroupIngressRule registers a new resource with the given unique name, arguments, and options.
   109  func NewSecurityGroupIngressRule(ctx *pulumi.Context,
   110  	name string, args *SecurityGroupIngressRuleArgs, opts ...pulumi.ResourceOption) (*SecurityGroupIngressRule, error) {
   111  	if args == nil {
   112  		return nil, errors.New("missing one or more required arguments")
   113  	}
   114  
   115  	if args.IpProtocol == nil {
   116  		return nil, errors.New("invalid value for required argument 'IpProtocol'")
   117  	}
   118  	if args.SecurityGroupId == nil {
   119  		return nil, errors.New("invalid value for required argument 'SecurityGroupId'")
   120  	}
   121  	opts = internal.PkgResourceDefaultOpts(opts)
   122  	var resource SecurityGroupIngressRule
   123  	err := ctx.RegisterResource("aws:vpc/securityGroupIngressRule:SecurityGroupIngressRule", name, args, &resource, opts...)
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  	return &resource, nil
   128  }
   129  
   130  // GetSecurityGroupIngressRule gets an existing SecurityGroupIngressRule resource's state with the given name, ID, and optional
   131  // state properties that are used to uniquely qualify the lookup (nil if not required).
   132  func GetSecurityGroupIngressRule(ctx *pulumi.Context,
   133  	name string, id pulumi.IDInput, state *SecurityGroupIngressRuleState, opts ...pulumi.ResourceOption) (*SecurityGroupIngressRule, error) {
   134  	var resource SecurityGroupIngressRule
   135  	err := ctx.ReadResource("aws:vpc/securityGroupIngressRule:SecurityGroupIngressRule", name, id, state, &resource, opts...)
   136  	if err != nil {
   137  		return nil, err
   138  	}
   139  	return &resource, nil
   140  }
   141  
   142  // Input properties used for looking up and filtering SecurityGroupIngressRule resources.
   143  type securityGroupIngressRuleState struct {
   144  	// The Amazon Resource Name (ARN) of the security group rule.
   145  	Arn *string `pulumi:"arn"`
   146  	// The source IPv4 CIDR range.
   147  	CidrIpv4 *string `pulumi:"cidrIpv4"`
   148  	// The source IPv6 CIDR range.
   149  	CidrIpv6 *string `pulumi:"cidrIpv6"`
   150  	// The security group rule description.
   151  	Description *string `pulumi:"description"`
   152  	// The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
   153  	FromPort *int `pulumi:"fromPort"`
   154  	// The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ipProtocol` is set to `-1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined.
   155  	IpProtocol *string `pulumi:"ipProtocol"`
   156  	// The ID of the source prefix list.
   157  	PrefixListId *string `pulumi:"prefixListId"`
   158  	// The source security group that is referenced in the rule.
   159  	ReferencedSecurityGroupId *string `pulumi:"referencedSecurityGroupId"`
   160  	// The ID of the security group.
   161  	SecurityGroupId *string `pulumi:"securityGroupId"`
   162  	// The ID of the security group rule.
   163  	SecurityGroupRuleId *string `pulumi:"securityGroupRuleId"`
   164  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   165  	Tags map[string]string `pulumi:"tags"`
   166  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   167  	//
   168  	// Deprecated: Please use `tags` instead.
   169  	TagsAll map[string]string `pulumi:"tagsAll"`
   170  	// The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
   171  	ToPort *int `pulumi:"toPort"`
   172  }
   173  
   174  type SecurityGroupIngressRuleState struct {
   175  	// The Amazon Resource Name (ARN) of the security group rule.
   176  	Arn pulumi.StringPtrInput
   177  	// The source IPv4 CIDR range.
   178  	CidrIpv4 pulumi.StringPtrInput
   179  	// The source IPv6 CIDR range.
   180  	CidrIpv6 pulumi.StringPtrInput
   181  	// The security group rule description.
   182  	Description pulumi.StringPtrInput
   183  	// The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
   184  	FromPort pulumi.IntPtrInput
   185  	// The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ipProtocol` is set to `-1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined.
   186  	IpProtocol pulumi.StringPtrInput
   187  	// The ID of the source prefix list.
   188  	PrefixListId pulumi.StringPtrInput
   189  	// The source security group that is referenced in the rule.
   190  	ReferencedSecurityGroupId pulumi.StringPtrInput
   191  	// The ID of the security group.
   192  	SecurityGroupId pulumi.StringPtrInput
   193  	// The ID of the security group rule.
   194  	SecurityGroupRuleId pulumi.StringPtrInput
   195  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   196  	Tags pulumi.StringMapInput
   197  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   198  	//
   199  	// Deprecated: Please use `tags` instead.
   200  	TagsAll pulumi.StringMapInput
   201  	// The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
   202  	ToPort pulumi.IntPtrInput
   203  }
   204  
   205  func (SecurityGroupIngressRuleState) ElementType() reflect.Type {
   206  	return reflect.TypeOf((*securityGroupIngressRuleState)(nil)).Elem()
   207  }
   208  
   209  type securityGroupIngressRuleArgs struct {
   210  	// The source IPv4 CIDR range.
   211  	CidrIpv4 *string `pulumi:"cidrIpv4"`
   212  	// The source IPv6 CIDR range.
   213  	CidrIpv6 *string `pulumi:"cidrIpv6"`
   214  	// The security group rule description.
   215  	Description *string `pulumi:"description"`
   216  	// The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
   217  	FromPort *int `pulumi:"fromPort"`
   218  	// The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ipProtocol` is set to `-1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined.
   219  	IpProtocol string `pulumi:"ipProtocol"`
   220  	// The ID of the source prefix list.
   221  	PrefixListId *string `pulumi:"prefixListId"`
   222  	// The source security group that is referenced in the rule.
   223  	ReferencedSecurityGroupId *string `pulumi:"referencedSecurityGroupId"`
   224  	// The ID of the security group.
   225  	SecurityGroupId string `pulumi:"securityGroupId"`
   226  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   227  	Tags map[string]string `pulumi:"tags"`
   228  	// The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
   229  	ToPort *int `pulumi:"toPort"`
   230  }
   231  
   232  // The set of arguments for constructing a SecurityGroupIngressRule resource.
   233  type SecurityGroupIngressRuleArgs struct {
   234  	// The source IPv4 CIDR range.
   235  	CidrIpv4 pulumi.StringPtrInput
   236  	// The source IPv6 CIDR range.
   237  	CidrIpv6 pulumi.StringPtrInput
   238  	// The security group rule description.
   239  	Description pulumi.StringPtrInput
   240  	// The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
   241  	FromPort pulumi.IntPtrInput
   242  	// The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ipProtocol` is set to `-1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined.
   243  	IpProtocol pulumi.StringInput
   244  	// The ID of the source prefix list.
   245  	PrefixListId pulumi.StringPtrInput
   246  	// The source security group that is referenced in the rule.
   247  	ReferencedSecurityGroupId pulumi.StringPtrInput
   248  	// The ID of the security group.
   249  	SecurityGroupId pulumi.StringInput
   250  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   251  	Tags pulumi.StringMapInput
   252  	// The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
   253  	ToPort pulumi.IntPtrInput
   254  }
   255  
   256  func (SecurityGroupIngressRuleArgs) ElementType() reflect.Type {
   257  	return reflect.TypeOf((*securityGroupIngressRuleArgs)(nil)).Elem()
   258  }
   259  
   260  type SecurityGroupIngressRuleInput interface {
   261  	pulumi.Input
   262  
   263  	ToSecurityGroupIngressRuleOutput() SecurityGroupIngressRuleOutput
   264  	ToSecurityGroupIngressRuleOutputWithContext(ctx context.Context) SecurityGroupIngressRuleOutput
   265  }
   266  
   267  func (*SecurityGroupIngressRule) ElementType() reflect.Type {
   268  	return reflect.TypeOf((**SecurityGroupIngressRule)(nil)).Elem()
   269  }
   270  
   271  func (i *SecurityGroupIngressRule) ToSecurityGroupIngressRuleOutput() SecurityGroupIngressRuleOutput {
   272  	return i.ToSecurityGroupIngressRuleOutputWithContext(context.Background())
   273  }
   274  
   275  func (i *SecurityGroupIngressRule) ToSecurityGroupIngressRuleOutputWithContext(ctx context.Context) SecurityGroupIngressRuleOutput {
   276  	return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupIngressRuleOutput)
   277  }
   278  
   279  // SecurityGroupIngressRuleArrayInput is an input type that accepts SecurityGroupIngressRuleArray and SecurityGroupIngressRuleArrayOutput values.
   280  // You can construct a concrete instance of `SecurityGroupIngressRuleArrayInput` via:
   281  //
   282  //	SecurityGroupIngressRuleArray{ SecurityGroupIngressRuleArgs{...} }
   283  type SecurityGroupIngressRuleArrayInput interface {
   284  	pulumi.Input
   285  
   286  	ToSecurityGroupIngressRuleArrayOutput() SecurityGroupIngressRuleArrayOutput
   287  	ToSecurityGroupIngressRuleArrayOutputWithContext(context.Context) SecurityGroupIngressRuleArrayOutput
   288  }
   289  
   290  type SecurityGroupIngressRuleArray []SecurityGroupIngressRuleInput
   291  
   292  func (SecurityGroupIngressRuleArray) ElementType() reflect.Type {
   293  	return reflect.TypeOf((*[]*SecurityGroupIngressRule)(nil)).Elem()
   294  }
   295  
   296  func (i SecurityGroupIngressRuleArray) ToSecurityGroupIngressRuleArrayOutput() SecurityGroupIngressRuleArrayOutput {
   297  	return i.ToSecurityGroupIngressRuleArrayOutputWithContext(context.Background())
   298  }
   299  
   300  func (i SecurityGroupIngressRuleArray) ToSecurityGroupIngressRuleArrayOutputWithContext(ctx context.Context) SecurityGroupIngressRuleArrayOutput {
   301  	return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupIngressRuleArrayOutput)
   302  }
   303  
   304  // SecurityGroupIngressRuleMapInput is an input type that accepts SecurityGroupIngressRuleMap and SecurityGroupIngressRuleMapOutput values.
   305  // You can construct a concrete instance of `SecurityGroupIngressRuleMapInput` via:
   306  //
   307  //	SecurityGroupIngressRuleMap{ "key": SecurityGroupIngressRuleArgs{...} }
   308  type SecurityGroupIngressRuleMapInput interface {
   309  	pulumi.Input
   310  
   311  	ToSecurityGroupIngressRuleMapOutput() SecurityGroupIngressRuleMapOutput
   312  	ToSecurityGroupIngressRuleMapOutputWithContext(context.Context) SecurityGroupIngressRuleMapOutput
   313  }
   314  
   315  type SecurityGroupIngressRuleMap map[string]SecurityGroupIngressRuleInput
   316  
   317  func (SecurityGroupIngressRuleMap) ElementType() reflect.Type {
   318  	return reflect.TypeOf((*map[string]*SecurityGroupIngressRule)(nil)).Elem()
   319  }
   320  
   321  func (i SecurityGroupIngressRuleMap) ToSecurityGroupIngressRuleMapOutput() SecurityGroupIngressRuleMapOutput {
   322  	return i.ToSecurityGroupIngressRuleMapOutputWithContext(context.Background())
   323  }
   324  
   325  func (i SecurityGroupIngressRuleMap) ToSecurityGroupIngressRuleMapOutputWithContext(ctx context.Context) SecurityGroupIngressRuleMapOutput {
   326  	return pulumi.ToOutputWithContext(ctx, i).(SecurityGroupIngressRuleMapOutput)
   327  }
   328  
   329  type SecurityGroupIngressRuleOutput struct{ *pulumi.OutputState }
   330  
   331  func (SecurityGroupIngressRuleOutput) ElementType() reflect.Type {
   332  	return reflect.TypeOf((**SecurityGroupIngressRule)(nil)).Elem()
   333  }
   334  
   335  func (o SecurityGroupIngressRuleOutput) ToSecurityGroupIngressRuleOutput() SecurityGroupIngressRuleOutput {
   336  	return o
   337  }
   338  
   339  func (o SecurityGroupIngressRuleOutput) ToSecurityGroupIngressRuleOutputWithContext(ctx context.Context) SecurityGroupIngressRuleOutput {
   340  	return o
   341  }
   342  
   343  // The Amazon Resource Name (ARN) of the security group rule.
   344  func (o SecurityGroupIngressRuleOutput) Arn() pulumi.StringOutput {
   345  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   346  }
   347  
   348  // The source IPv4 CIDR range.
   349  func (o SecurityGroupIngressRuleOutput) CidrIpv4() pulumi.StringPtrOutput {
   350  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringPtrOutput { return v.CidrIpv4 }).(pulumi.StringPtrOutput)
   351  }
   352  
   353  // The source IPv6 CIDR range.
   354  func (o SecurityGroupIngressRuleOutput) CidrIpv6() pulumi.StringPtrOutput {
   355  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringPtrOutput { return v.CidrIpv6 }).(pulumi.StringPtrOutput)
   356  }
   357  
   358  // The security group rule description.
   359  func (o SecurityGroupIngressRuleOutput) Description() pulumi.StringPtrOutput {
   360  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   361  }
   362  
   363  // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
   364  func (o SecurityGroupIngressRuleOutput) FromPort() pulumi.IntPtrOutput {
   365  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.IntPtrOutput { return v.FromPort }).(pulumi.IntPtrOutput)
   366  }
   367  
   368  // The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ipProtocol` is set to `-1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined.
   369  func (o SecurityGroupIngressRuleOutput) IpProtocol() pulumi.StringOutput {
   370  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringOutput { return v.IpProtocol }).(pulumi.StringOutput)
   371  }
   372  
   373  // The ID of the source prefix list.
   374  func (o SecurityGroupIngressRuleOutput) PrefixListId() pulumi.StringPtrOutput {
   375  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringPtrOutput { return v.PrefixListId }).(pulumi.StringPtrOutput)
   376  }
   377  
   378  // The source security group that is referenced in the rule.
   379  func (o SecurityGroupIngressRuleOutput) ReferencedSecurityGroupId() pulumi.StringPtrOutput {
   380  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringPtrOutput { return v.ReferencedSecurityGroupId }).(pulumi.StringPtrOutput)
   381  }
   382  
   383  // The ID of the security group.
   384  func (o SecurityGroupIngressRuleOutput) SecurityGroupId() pulumi.StringOutput {
   385  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringOutput { return v.SecurityGroupId }).(pulumi.StringOutput)
   386  }
   387  
   388  // The ID of the security group rule.
   389  func (o SecurityGroupIngressRuleOutput) SecurityGroupRuleId() pulumi.StringOutput {
   390  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringOutput { return v.SecurityGroupRuleId }).(pulumi.StringOutput)
   391  }
   392  
   393  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   394  func (o SecurityGroupIngressRuleOutput) Tags() pulumi.StringMapOutput {
   395  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   396  }
   397  
   398  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   399  //
   400  // Deprecated: Please use `tags` instead.
   401  func (o SecurityGroupIngressRuleOutput) TagsAll() pulumi.StringMapOutput {
   402  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   403  }
   404  
   405  // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
   406  func (o SecurityGroupIngressRuleOutput) ToPort() pulumi.IntPtrOutput {
   407  	return o.ApplyT(func(v *SecurityGroupIngressRule) pulumi.IntPtrOutput { return v.ToPort }).(pulumi.IntPtrOutput)
   408  }
   409  
   410  type SecurityGroupIngressRuleArrayOutput struct{ *pulumi.OutputState }
   411  
   412  func (SecurityGroupIngressRuleArrayOutput) ElementType() reflect.Type {
   413  	return reflect.TypeOf((*[]*SecurityGroupIngressRule)(nil)).Elem()
   414  }
   415  
   416  func (o SecurityGroupIngressRuleArrayOutput) ToSecurityGroupIngressRuleArrayOutput() SecurityGroupIngressRuleArrayOutput {
   417  	return o
   418  }
   419  
   420  func (o SecurityGroupIngressRuleArrayOutput) ToSecurityGroupIngressRuleArrayOutputWithContext(ctx context.Context) SecurityGroupIngressRuleArrayOutput {
   421  	return o
   422  }
   423  
   424  func (o SecurityGroupIngressRuleArrayOutput) Index(i pulumi.IntInput) SecurityGroupIngressRuleOutput {
   425  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SecurityGroupIngressRule {
   426  		return vs[0].([]*SecurityGroupIngressRule)[vs[1].(int)]
   427  	}).(SecurityGroupIngressRuleOutput)
   428  }
   429  
   430  type SecurityGroupIngressRuleMapOutput struct{ *pulumi.OutputState }
   431  
   432  func (SecurityGroupIngressRuleMapOutput) ElementType() reflect.Type {
   433  	return reflect.TypeOf((*map[string]*SecurityGroupIngressRule)(nil)).Elem()
   434  }
   435  
   436  func (o SecurityGroupIngressRuleMapOutput) ToSecurityGroupIngressRuleMapOutput() SecurityGroupIngressRuleMapOutput {
   437  	return o
   438  }
   439  
   440  func (o SecurityGroupIngressRuleMapOutput) ToSecurityGroupIngressRuleMapOutputWithContext(ctx context.Context) SecurityGroupIngressRuleMapOutput {
   441  	return o
   442  }
   443  
   444  func (o SecurityGroupIngressRuleMapOutput) MapIndex(k pulumi.StringInput) SecurityGroupIngressRuleOutput {
   445  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SecurityGroupIngressRule {
   446  		return vs[0].(map[string]*SecurityGroupIngressRule)[vs[1].(string)]
   447  	}).(SecurityGroupIngressRuleOutput)
   448  }
   449  
   450  func init() {
   451  	pulumi.RegisterInputType(reflect.TypeOf((*SecurityGroupIngressRuleInput)(nil)).Elem(), &SecurityGroupIngressRule{})
   452  	pulumi.RegisterInputType(reflect.TypeOf((*SecurityGroupIngressRuleArrayInput)(nil)).Elem(), SecurityGroupIngressRuleArray{})
   453  	pulumi.RegisterInputType(reflect.TypeOf((*SecurityGroupIngressRuleMapInput)(nil)).Elem(), SecurityGroupIngressRuleMap{})
   454  	pulumi.RegisterOutputType(SecurityGroupIngressRuleOutput{})
   455  	pulumi.RegisterOutputType(SecurityGroupIngressRuleArrayOutput{})
   456  	pulumi.RegisterOutputType(SecurityGroupIngressRuleMapOutput{})
   457  }