github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getLocalGateway.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 an EC2 Local Gateway. 15 // 16 // ## Example Usage 17 // 18 // The following example shows how one might accept a local gateway id as a variable. 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // cfg := config.New(ctx, "") 35 // localGatewayId := cfg.RequireObject("localGatewayId") 36 // _, err := ec2.GetLocalGateway(ctx, &ec2.GetLocalGatewayArgs{ 37 // Id: pulumi.StringRef(localGatewayId), 38 // }, nil) 39 // if err != nil { 40 // return err 41 // } 42 // return nil 43 // }) 44 // } 45 // 46 // ``` 47 // <!--End PulumiCodeChooser --> 48 func GetLocalGateway(ctx *pulumi.Context, args *GetLocalGatewayArgs, opts ...pulumi.InvokeOption) (*GetLocalGatewayResult, error) { 49 opts = internal.PkgInvokeDefaultOpts(opts) 50 var rv GetLocalGatewayResult 51 err := ctx.Invoke("aws:ec2/getLocalGateway:getLocalGateway", args, &rv, opts...) 52 if err != nil { 53 return nil, err 54 } 55 return &rv, nil 56 } 57 58 // A collection of arguments for invoking getLocalGateway. 59 type GetLocalGatewayArgs struct { 60 // Custom filter block as described below. 61 Filters []GetLocalGatewayFilter `pulumi:"filters"` 62 // Id of the specific Local Gateway to retrieve. 63 Id *string `pulumi:"id"` 64 // Current state of the desired Local Gateway. 65 // Can be either `"pending"` or `"available"`. 66 State *string `pulumi:"state"` 67 // Mapping of tags, each pair of which must exactly match 68 // a pair on the desired Local Gateway. 69 // 70 // More complex filters can be expressed using one or more `filter` sub-blocks, 71 // which take the following arguments: 72 Tags map[string]string `pulumi:"tags"` 73 } 74 75 // A collection of values returned by getLocalGateway. 76 type GetLocalGatewayResult struct { 77 Filters []GetLocalGatewayFilter `pulumi:"filters"` 78 Id string `pulumi:"id"` 79 // ARN of Outpost 80 OutpostArn string `pulumi:"outpostArn"` 81 // AWS account identifier that owns the Local Gateway. 82 OwnerId string `pulumi:"ownerId"` 83 // State of the local gateway. 84 State string `pulumi:"state"` 85 Tags map[string]string `pulumi:"tags"` 86 } 87 88 func GetLocalGatewayOutput(ctx *pulumi.Context, args GetLocalGatewayOutputArgs, opts ...pulumi.InvokeOption) GetLocalGatewayResultOutput { 89 return pulumi.ToOutputWithContext(context.Background(), args). 90 ApplyT(func(v interface{}) (GetLocalGatewayResult, error) { 91 args := v.(GetLocalGatewayArgs) 92 r, err := GetLocalGateway(ctx, &args, opts...) 93 var s GetLocalGatewayResult 94 if r != nil { 95 s = *r 96 } 97 return s, err 98 }).(GetLocalGatewayResultOutput) 99 } 100 101 // A collection of arguments for invoking getLocalGateway. 102 type GetLocalGatewayOutputArgs struct { 103 // Custom filter block as described below. 104 Filters GetLocalGatewayFilterArrayInput `pulumi:"filters"` 105 // Id of the specific Local Gateway to retrieve. 106 Id pulumi.StringPtrInput `pulumi:"id"` 107 // Current state of the desired Local Gateway. 108 // Can be either `"pending"` or `"available"`. 109 State pulumi.StringPtrInput `pulumi:"state"` 110 // Mapping of tags, each pair of which must exactly match 111 // a pair on the desired Local Gateway. 112 // 113 // More complex filters can be expressed using one or more `filter` sub-blocks, 114 // which take the following arguments: 115 Tags pulumi.StringMapInput `pulumi:"tags"` 116 } 117 118 func (GetLocalGatewayOutputArgs) ElementType() reflect.Type { 119 return reflect.TypeOf((*GetLocalGatewayArgs)(nil)).Elem() 120 } 121 122 // A collection of values returned by getLocalGateway. 123 type GetLocalGatewayResultOutput struct{ *pulumi.OutputState } 124 125 func (GetLocalGatewayResultOutput) ElementType() reflect.Type { 126 return reflect.TypeOf((*GetLocalGatewayResult)(nil)).Elem() 127 } 128 129 func (o GetLocalGatewayResultOutput) ToGetLocalGatewayResultOutput() GetLocalGatewayResultOutput { 130 return o 131 } 132 133 func (o GetLocalGatewayResultOutput) ToGetLocalGatewayResultOutputWithContext(ctx context.Context) GetLocalGatewayResultOutput { 134 return o 135 } 136 137 func (o GetLocalGatewayResultOutput) Filters() GetLocalGatewayFilterArrayOutput { 138 return o.ApplyT(func(v GetLocalGatewayResult) []GetLocalGatewayFilter { return v.Filters }).(GetLocalGatewayFilterArrayOutput) 139 } 140 141 func (o GetLocalGatewayResultOutput) Id() pulumi.StringOutput { 142 return o.ApplyT(func(v GetLocalGatewayResult) string { return v.Id }).(pulumi.StringOutput) 143 } 144 145 // ARN of Outpost 146 func (o GetLocalGatewayResultOutput) OutpostArn() pulumi.StringOutput { 147 return o.ApplyT(func(v GetLocalGatewayResult) string { return v.OutpostArn }).(pulumi.StringOutput) 148 } 149 150 // AWS account identifier that owns the Local Gateway. 151 func (o GetLocalGatewayResultOutput) OwnerId() pulumi.StringOutput { 152 return o.ApplyT(func(v GetLocalGatewayResult) string { return v.OwnerId }).(pulumi.StringOutput) 153 } 154 155 // State of the local gateway. 156 func (o GetLocalGatewayResultOutput) State() pulumi.StringOutput { 157 return o.ApplyT(func(v GetLocalGatewayResult) string { return v.State }).(pulumi.StringOutput) 158 } 159 160 func (o GetLocalGatewayResultOutput) Tags() pulumi.StringMapOutput { 161 return o.ApplyT(func(v GetLocalGatewayResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 162 } 163 164 func init() { 165 pulumi.RegisterOutputType(GetLocalGatewayResultOutput{}) 166 }