github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/directconnect/getGateway.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 directconnect 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 // Retrieve information about a Direct Connect 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/directconnect" 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 := directconnect.LookupGateway(ctx, &directconnect.LookupGatewayArgs{ 32 // Name: "example", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func LookupGateway(ctx *pulumi.Context, args *LookupGatewayArgs, opts ...pulumi.InvokeOption) (*LookupGatewayResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv LookupGatewayResult 46 err := ctx.Invoke("aws:directconnect/getGateway:getGateway", args, &rv, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &rv, nil 51 } 52 53 // A collection of arguments for invoking getGateway. 54 type LookupGatewayArgs struct { 55 // Name of the gateway to retrieve. 56 Name string `pulumi:"name"` 57 } 58 59 // A collection of values returned by getGateway. 60 type LookupGatewayResult struct { 61 // ASN on the Amazon side of the connection. 62 AmazonSideAsn string `pulumi:"amazonSideAsn"` 63 // The provider-assigned unique ID for this managed resource. 64 Id string `pulumi:"id"` 65 Name string `pulumi:"name"` 66 // AWS Account ID of the gateway. 67 OwnerAccountId string `pulumi:"ownerAccountId"` 68 } 69 70 func LookupGatewayOutput(ctx *pulumi.Context, args LookupGatewayOutputArgs, opts ...pulumi.InvokeOption) LookupGatewayResultOutput { 71 return pulumi.ToOutputWithContext(context.Background(), args). 72 ApplyT(func(v interface{}) (LookupGatewayResult, error) { 73 args := v.(LookupGatewayArgs) 74 r, err := LookupGateway(ctx, &args, opts...) 75 var s LookupGatewayResult 76 if r != nil { 77 s = *r 78 } 79 return s, err 80 }).(LookupGatewayResultOutput) 81 } 82 83 // A collection of arguments for invoking getGateway. 84 type LookupGatewayOutputArgs struct { 85 // Name of the gateway to retrieve. 86 Name pulumi.StringInput `pulumi:"name"` 87 } 88 89 func (LookupGatewayOutputArgs) ElementType() reflect.Type { 90 return reflect.TypeOf((*LookupGatewayArgs)(nil)).Elem() 91 } 92 93 // A collection of values returned by getGateway. 94 type LookupGatewayResultOutput struct{ *pulumi.OutputState } 95 96 func (LookupGatewayResultOutput) ElementType() reflect.Type { 97 return reflect.TypeOf((*LookupGatewayResult)(nil)).Elem() 98 } 99 100 func (o LookupGatewayResultOutput) ToLookupGatewayResultOutput() LookupGatewayResultOutput { 101 return o 102 } 103 104 func (o LookupGatewayResultOutput) ToLookupGatewayResultOutputWithContext(ctx context.Context) LookupGatewayResultOutput { 105 return o 106 } 107 108 // ASN on the Amazon side of the connection. 109 func (o LookupGatewayResultOutput) AmazonSideAsn() pulumi.StringOutput { 110 return o.ApplyT(func(v LookupGatewayResult) string { return v.AmazonSideAsn }).(pulumi.StringOutput) 111 } 112 113 // The provider-assigned unique ID for this managed resource. 114 func (o LookupGatewayResultOutput) Id() pulumi.StringOutput { 115 return o.ApplyT(func(v LookupGatewayResult) string { return v.Id }).(pulumi.StringOutput) 116 } 117 118 func (o LookupGatewayResultOutput) Name() pulumi.StringOutput { 119 return o.ApplyT(func(v LookupGatewayResult) string { return v.Name }).(pulumi.StringOutput) 120 } 121 122 // AWS Account ID of the gateway. 123 func (o LookupGatewayResultOutput) OwnerAccountId() pulumi.StringOutput { 124 return o.ApplyT(func(v LookupGatewayResult) string { return v.OwnerAccountId }).(pulumi.StringOutput) 125 } 126 127 func init() { 128 pulumi.RegisterOutputType(LookupGatewayResultOutput{}) 129 }