github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getNatGateway.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 ec2
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides details about a specific VPC NAT Gateway.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := ec2.LookupNatGateway(ctx, &ec2.LookupNatGatewayArgs{
    32  //				SubnetId: pulumi.StringRef(public.Id),
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  //
    44  // ### With tags
    45  //
    46  // <!--Start PulumiCodeChooser -->
    47  // ```go
    48  // package main
    49  //
    50  // import (
    51  //
    52  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    53  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    54  //
    55  // )
    56  //
    57  //	func main() {
    58  //		pulumi.Run(func(ctx *pulumi.Context) error {
    59  //			_, err := ec2.LookupNatGateway(ctx, &ec2.LookupNatGatewayArgs{
    60  //				SubnetId: pulumi.StringRef(public.Id),
    61  //				Tags: map[string]interface{}{
    62  //					"Name": "gw NAT",
    63  //				},
    64  //			}, nil)
    65  //			if err != nil {
    66  //				return err
    67  //			}
    68  //			return nil
    69  //		})
    70  //	}
    71  //
    72  // ```
    73  // <!--End PulumiCodeChooser -->
    74  func LookupNatGateway(ctx *pulumi.Context, args *LookupNatGatewayArgs, opts ...pulumi.InvokeOption) (*LookupNatGatewayResult, error) {
    75  	opts = internal.PkgInvokeDefaultOpts(opts)
    76  	var rv LookupNatGatewayResult
    77  	err := ctx.Invoke("aws:ec2/getNatGateway:getNatGateway", args, &rv, opts...)
    78  	if err != nil {
    79  		return nil, err
    80  	}
    81  	return &rv, nil
    82  }
    83  
    84  // A collection of arguments for invoking getNatGateway.
    85  type LookupNatGatewayArgs struct {
    86  	// Custom filter block as described below.
    87  	//
    88  	// More complex filters can be expressed using one or more `filter` sub-blocks,
    89  	// which take the following arguments:
    90  	Filters []GetNatGatewayFilter `pulumi:"filters"`
    91  	// ID of the specific NAT Gateway to retrieve.
    92  	Id *string `pulumi:"id"`
    93  	// State of the NAT Gateway (pending | failed | available | deleting | deleted ).
    94  	State *string `pulumi:"state"`
    95  	// ID of subnet that the NAT Gateway resides in.
    96  	SubnetId *string `pulumi:"subnetId"`
    97  	// Map of tags, each pair of which must exactly match
    98  	// a pair on the desired NAT Gateway.
    99  	Tags map[string]string `pulumi:"tags"`
   100  	// ID of the VPC that the NAT Gateway resides in.
   101  	VpcId *string `pulumi:"vpcId"`
   102  }
   103  
   104  // A collection of values returned by getNatGateway.
   105  type LookupNatGatewayResult struct {
   106  	// ID of the EIP allocated to the selected NAT Gateway.
   107  	AllocationId string `pulumi:"allocationId"`
   108  	// The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when `connectivityType` is `public`.
   109  	AssociationId string `pulumi:"associationId"`
   110  	// Connectivity type of the NAT Gateway.
   111  	ConnectivityType string                `pulumi:"connectivityType"`
   112  	Filters          []GetNatGatewayFilter `pulumi:"filters"`
   113  	Id               string                `pulumi:"id"`
   114  	// The ID of the ENI allocated to the selected NAT Gateway.
   115  	NetworkInterfaceId string `pulumi:"networkInterfaceId"`
   116  	// Private IP address of the selected NAT Gateway.
   117  	PrivateIp string `pulumi:"privateIp"`
   118  	// Public IP (EIP) address of the selected NAT Gateway.
   119  	PublicIp string `pulumi:"publicIp"`
   120  	// Secondary allocation EIP IDs for the selected NAT Gateway.
   121  	SecondaryAllocationIds []string `pulumi:"secondaryAllocationIds"`
   122  	// The number of secondary private IPv4 addresses assigned to the selected NAT Gateway.
   123  	SecondaryPrivateIpAddressCount int `pulumi:"secondaryPrivateIpAddressCount"`
   124  	// Secondary private IPv4 addresses assigned to the selected NAT Gateway.
   125  	SecondaryPrivateIpAddresses []string          `pulumi:"secondaryPrivateIpAddresses"`
   126  	State                       string            `pulumi:"state"`
   127  	SubnetId                    string            `pulumi:"subnetId"`
   128  	Tags                        map[string]string `pulumi:"tags"`
   129  	VpcId                       string            `pulumi:"vpcId"`
   130  }
   131  
   132  func LookupNatGatewayOutput(ctx *pulumi.Context, args LookupNatGatewayOutputArgs, opts ...pulumi.InvokeOption) LookupNatGatewayResultOutput {
   133  	return pulumi.ToOutputWithContext(context.Background(), args).
   134  		ApplyT(func(v interface{}) (LookupNatGatewayResult, error) {
   135  			args := v.(LookupNatGatewayArgs)
   136  			r, err := LookupNatGateway(ctx, &args, opts...)
   137  			var s LookupNatGatewayResult
   138  			if r != nil {
   139  				s = *r
   140  			}
   141  			return s, err
   142  		}).(LookupNatGatewayResultOutput)
   143  }
   144  
   145  // A collection of arguments for invoking getNatGateway.
   146  type LookupNatGatewayOutputArgs struct {
   147  	// Custom filter block as described below.
   148  	//
   149  	// More complex filters can be expressed using one or more `filter` sub-blocks,
   150  	// which take the following arguments:
   151  	Filters GetNatGatewayFilterArrayInput `pulumi:"filters"`
   152  	// ID of the specific NAT Gateway to retrieve.
   153  	Id pulumi.StringPtrInput `pulumi:"id"`
   154  	// State of the NAT Gateway (pending | failed | available | deleting | deleted ).
   155  	State pulumi.StringPtrInput `pulumi:"state"`
   156  	// ID of subnet that the NAT Gateway resides in.
   157  	SubnetId pulumi.StringPtrInput `pulumi:"subnetId"`
   158  	// Map of tags, each pair of which must exactly match
   159  	// a pair on the desired NAT Gateway.
   160  	Tags pulumi.StringMapInput `pulumi:"tags"`
   161  	// ID of the VPC that the NAT Gateway resides in.
   162  	VpcId pulumi.StringPtrInput `pulumi:"vpcId"`
   163  }
   164  
   165  func (LookupNatGatewayOutputArgs) ElementType() reflect.Type {
   166  	return reflect.TypeOf((*LookupNatGatewayArgs)(nil)).Elem()
   167  }
   168  
   169  // A collection of values returned by getNatGateway.
   170  type LookupNatGatewayResultOutput struct{ *pulumi.OutputState }
   171  
   172  func (LookupNatGatewayResultOutput) ElementType() reflect.Type {
   173  	return reflect.TypeOf((*LookupNatGatewayResult)(nil)).Elem()
   174  }
   175  
   176  func (o LookupNatGatewayResultOutput) ToLookupNatGatewayResultOutput() LookupNatGatewayResultOutput {
   177  	return o
   178  }
   179  
   180  func (o LookupNatGatewayResultOutput) ToLookupNatGatewayResultOutputWithContext(ctx context.Context) LookupNatGatewayResultOutput {
   181  	return o
   182  }
   183  
   184  // ID of the EIP allocated to the selected NAT Gateway.
   185  func (o LookupNatGatewayResultOutput) AllocationId() pulumi.StringOutput {
   186  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.AllocationId }).(pulumi.StringOutput)
   187  }
   188  
   189  // The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when `connectivityType` is `public`.
   190  func (o LookupNatGatewayResultOutput) AssociationId() pulumi.StringOutput {
   191  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.AssociationId }).(pulumi.StringOutput)
   192  }
   193  
   194  // Connectivity type of the NAT Gateway.
   195  func (o LookupNatGatewayResultOutput) ConnectivityType() pulumi.StringOutput {
   196  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.ConnectivityType }).(pulumi.StringOutput)
   197  }
   198  
   199  func (o LookupNatGatewayResultOutput) Filters() GetNatGatewayFilterArrayOutput {
   200  	return o.ApplyT(func(v LookupNatGatewayResult) []GetNatGatewayFilter { return v.Filters }).(GetNatGatewayFilterArrayOutput)
   201  }
   202  
   203  func (o LookupNatGatewayResultOutput) Id() pulumi.StringOutput {
   204  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.Id }).(pulumi.StringOutput)
   205  }
   206  
   207  // The ID of the ENI allocated to the selected NAT Gateway.
   208  func (o LookupNatGatewayResultOutput) NetworkInterfaceId() pulumi.StringOutput {
   209  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.NetworkInterfaceId }).(pulumi.StringOutput)
   210  }
   211  
   212  // Private IP address of the selected NAT Gateway.
   213  func (o LookupNatGatewayResultOutput) PrivateIp() pulumi.StringOutput {
   214  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.PrivateIp }).(pulumi.StringOutput)
   215  }
   216  
   217  // Public IP (EIP) address of the selected NAT Gateway.
   218  func (o LookupNatGatewayResultOutput) PublicIp() pulumi.StringOutput {
   219  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.PublicIp }).(pulumi.StringOutput)
   220  }
   221  
   222  // Secondary allocation EIP IDs for the selected NAT Gateway.
   223  func (o LookupNatGatewayResultOutput) SecondaryAllocationIds() pulumi.StringArrayOutput {
   224  	return o.ApplyT(func(v LookupNatGatewayResult) []string { return v.SecondaryAllocationIds }).(pulumi.StringArrayOutput)
   225  }
   226  
   227  // The number of secondary private IPv4 addresses assigned to the selected NAT Gateway.
   228  func (o LookupNatGatewayResultOutput) SecondaryPrivateIpAddressCount() pulumi.IntOutput {
   229  	return o.ApplyT(func(v LookupNatGatewayResult) int { return v.SecondaryPrivateIpAddressCount }).(pulumi.IntOutput)
   230  }
   231  
   232  // Secondary private IPv4 addresses assigned to the selected NAT Gateway.
   233  func (o LookupNatGatewayResultOutput) SecondaryPrivateIpAddresses() pulumi.StringArrayOutput {
   234  	return o.ApplyT(func(v LookupNatGatewayResult) []string { return v.SecondaryPrivateIpAddresses }).(pulumi.StringArrayOutput)
   235  }
   236  
   237  func (o LookupNatGatewayResultOutput) State() pulumi.StringOutput {
   238  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.State }).(pulumi.StringOutput)
   239  }
   240  
   241  func (o LookupNatGatewayResultOutput) SubnetId() pulumi.StringOutput {
   242  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.SubnetId }).(pulumi.StringOutput)
   243  }
   244  
   245  func (o LookupNatGatewayResultOutput) Tags() pulumi.StringMapOutput {
   246  	return o.ApplyT(func(v LookupNatGatewayResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   247  }
   248  
   249  func (o LookupNatGatewayResultOutput) VpcId() pulumi.StringOutput {
   250  	return o.ApplyT(func(v LookupNatGatewayResult) string { return v.VpcId }).(pulumi.StringOutput)
   251  }
   252  
   253  func init() {
   254  	pulumi.RegisterOutputType(LookupNatGatewayResultOutput{})
   255  }