github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getNatGateways.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 // This resource can be useful for getting back a list of NAT gateway ids to be referenced elsewhere. 15 func GetNatGateways(ctx *pulumi.Context, args *GetNatGatewaysArgs, opts ...pulumi.InvokeOption) (*GetNatGatewaysResult, error) { 16 opts = internal.PkgInvokeDefaultOpts(opts) 17 var rv GetNatGatewaysResult 18 err := ctx.Invoke("aws:ec2/getNatGateways:getNatGateways", args, &rv, opts...) 19 if err != nil { 20 return nil, err 21 } 22 return &rv, nil 23 } 24 25 // A collection of arguments for invoking getNatGateways. 26 type GetNatGatewaysArgs struct { 27 // Custom filter block as described below. 28 Filters []GetNatGatewaysFilter `pulumi:"filters"` 29 // Map of tags, each pair of which must exactly match 30 // a pair on the desired NAT Gateways. 31 // 32 // More complex filters can be expressed using one or more `filter` sub-blocks, 33 // which take the following arguments: 34 Tags map[string]string `pulumi:"tags"` 35 // VPC ID that you want to filter from. 36 VpcId *string `pulumi:"vpcId"` 37 } 38 39 // A collection of values returned by getNatGateways. 40 type GetNatGatewaysResult struct { 41 Filters []GetNatGatewaysFilter `pulumi:"filters"` 42 // The provider-assigned unique ID for this managed resource. 43 Id string `pulumi:"id"` 44 // List of all the NAT gateway ids found. 45 Ids []string `pulumi:"ids"` 46 Tags map[string]string `pulumi:"tags"` 47 VpcId *string `pulumi:"vpcId"` 48 } 49 50 func GetNatGatewaysOutput(ctx *pulumi.Context, args GetNatGatewaysOutputArgs, opts ...pulumi.InvokeOption) GetNatGatewaysResultOutput { 51 return pulumi.ToOutputWithContext(context.Background(), args). 52 ApplyT(func(v interface{}) (GetNatGatewaysResult, error) { 53 args := v.(GetNatGatewaysArgs) 54 r, err := GetNatGateways(ctx, &args, opts...) 55 var s GetNatGatewaysResult 56 if r != nil { 57 s = *r 58 } 59 return s, err 60 }).(GetNatGatewaysResultOutput) 61 } 62 63 // A collection of arguments for invoking getNatGateways. 64 type GetNatGatewaysOutputArgs struct { 65 // Custom filter block as described below. 66 Filters GetNatGatewaysFilterArrayInput `pulumi:"filters"` 67 // Map of tags, each pair of which must exactly match 68 // a pair on the desired NAT Gateways. 69 // 70 // More complex filters can be expressed using one or more `filter` sub-blocks, 71 // which take the following arguments: 72 Tags pulumi.StringMapInput `pulumi:"tags"` 73 // VPC ID that you want to filter from. 74 VpcId pulumi.StringPtrInput `pulumi:"vpcId"` 75 } 76 77 func (GetNatGatewaysOutputArgs) ElementType() reflect.Type { 78 return reflect.TypeOf((*GetNatGatewaysArgs)(nil)).Elem() 79 } 80 81 // A collection of values returned by getNatGateways. 82 type GetNatGatewaysResultOutput struct{ *pulumi.OutputState } 83 84 func (GetNatGatewaysResultOutput) ElementType() reflect.Type { 85 return reflect.TypeOf((*GetNatGatewaysResult)(nil)).Elem() 86 } 87 88 func (o GetNatGatewaysResultOutput) ToGetNatGatewaysResultOutput() GetNatGatewaysResultOutput { 89 return o 90 } 91 92 func (o GetNatGatewaysResultOutput) ToGetNatGatewaysResultOutputWithContext(ctx context.Context) GetNatGatewaysResultOutput { 93 return o 94 } 95 96 func (o GetNatGatewaysResultOutput) Filters() GetNatGatewaysFilterArrayOutput { 97 return o.ApplyT(func(v GetNatGatewaysResult) []GetNatGatewaysFilter { return v.Filters }).(GetNatGatewaysFilterArrayOutput) 98 } 99 100 // The provider-assigned unique ID for this managed resource. 101 func (o GetNatGatewaysResultOutput) Id() pulumi.StringOutput { 102 return o.ApplyT(func(v GetNatGatewaysResult) string { return v.Id }).(pulumi.StringOutput) 103 } 104 105 // List of all the NAT gateway ids found. 106 func (o GetNatGatewaysResultOutput) Ids() pulumi.StringArrayOutput { 107 return o.ApplyT(func(v GetNatGatewaysResult) []string { return v.Ids }).(pulumi.StringArrayOutput) 108 } 109 110 func (o GetNatGatewaysResultOutput) Tags() pulumi.StringMapOutput { 111 return o.ApplyT(func(v GetNatGatewaysResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 112 } 113 114 func (o GetNatGatewaysResultOutput) VpcId() pulumi.StringPtrOutput { 115 return o.ApplyT(func(v GetNatGatewaysResult) *string { return v.VpcId }).(pulumi.StringPtrOutput) 116 } 117 118 func init() { 119 pulumi.RegisterOutputType(GetNatGatewaysResultOutput{}) 120 }