github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkmanager/getConnection.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 networkmanager 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 connection. 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/networkmanager" 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 := networkmanager.LookupConnection(ctx, &networkmanager.LookupConnectionArgs{ 32 // GlobalNetworkId: globalNetworkId, 33 // ConnectionId: connectionId, 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func LookupConnection(ctx *pulumi.Context, args *LookupConnectionArgs, opts ...pulumi.InvokeOption) (*LookupConnectionResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupConnectionResult 47 err := ctx.Invoke("aws:networkmanager/getConnection:getConnection", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getConnection. 55 type LookupConnectionArgs struct { 56 // ID of the specific connection to retrieve. 57 ConnectionId string `pulumi:"connectionId"` 58 // ID of the Global Network of the connection to retrieve. 59 GlobalNetworkId string `pulumi:"globalNetworkId"` 60 // Key-value tags for the connection. 61 Tags map[string]string `pulumi:"tags"` 62 } 63 64 // A collection of values returned by getConnection. 65 type LookupConnectionResult struct { 66 // ARN of the connection. 67 Arn string `pulumi:"arn"` 68 // ID of the second device in the connection. 69 ConnectedDeviceId string `pulumi:"connectedDeviceId"` 70 // ID of the link for the second device. 71 ConnectedLinkId string `pulumi:"connectedLinkId"` 72 ConnectionId string `pulumi:"connectionId"` 73 // Description of the connection. 74 Description string `pulumi:"description"` 75 // ID of the first device in the connection. 76 DeviceId string `pulumi:"deviceId"` 77 GlobalNetworkId string `pulumi:"globalNetworkId"` 78 // The provider-assigned unique ID for this managed resource. 79 Id string `pulumi:"id"` 80 // ID of the link for the first device. 81 LinkId string `pulumi:"linkId"` 82 // Key-value tags for the connection. 83 Tags map[string]string `pulumi:"tags"` 84 } 85 86 func LookupConnectionOutput(ctx *pulumi.Context, args LookupConnectionOutputArgs, opts ...pulumi.InvokeOption) LookupConnectionResultOutput { 87 return pulumi.ToOutputWithContext(context.Background(), args). 88 ApplyT(func(v interface{}) (LookupConnectionResult, error) { 89 args := v.(LookupConnectionArgs) 90 r, err := LookupConnection(ctx, &args, opts...) 91 var s LookupConnectionResult 92 if r != nil { 93 s = *r 94 } 95 return s, err 96 }).(LookupConnectionResultOutput) 97 } 98 99 // A collection of arguments for invoking getConnection. 100 type LookupConnectionOutputArgs struct { 101 // ID of the specific connection to retrieve. 102 ConnectionId pulumi.StringInput `pulumi:"connectionId"` 103 // ID of the Global Network of the connection to retrieve. 104 GlobalNetworkId pulumi.StringInput `pulumi:"globalNetworkId"` 105 // Key-value tags for the connection. 106 Tags pulumi.StringMapInput `pulumi:"tags"` 107 } 108 109 func (LookupConnectionOutputArgs) ElementType() reflect.Type { 110 return reflect.TypeOf((*LookupConnectionArgs)(nil)).Elem() 111 } 112 113 // A collection of values returned by getConnection. 114 type LookupConnectionResultOutput struct{ *pulumi.OutputState } 115 116 func (LookupConnectionResultOutput) ElementType() reflect.Type { 117 return reflect.TypeOf((*LookupConnectionResult)(nil)).Elem() 118 } 119 120 func (o LookupConnectionResultOutput) ToLookupConnectionResultOutput() LookupConnectionResultOutput { 121 return o 122 } 123 124 func (o LookupConnectionResultOutput) ToLookupConnectionResultOutputWithContext(ctx context.Context) LookupConnectionResultOutput { 125 return o 126 } 127 128 // ARN of the connection. 129 func (o LookupConnectionResultOutput) Arn() pulumi.StringOutput { 130 return o.ApplyT(func(v LookupConnectionResult) string { return v.Arn }).(pulumi.StringOutput) 131 } 132 133 // ID of the second device in the connection. 134 func (o LookupConnectionResultOutput) ConnectedDeviceId() pulumi.StringOutput { 135 return o.ApplyT(func(v LookupConnectionResult) string { return v.ConnectedDeviceId }).(pulumi.StringOutput) 136 } 137 138 // ID of the link for the second device. 139 func (o LookupConnectionResultOutput) ConnectedLinkId() pulumi.StringOutput { 140 return o.ApplyT(func(v LookupConnectionResult) string { return v.ConnectedLinkId }).(pulumi.StringOutput) 141 } 142 143 func (o LookupConnectionResultOutput) ConnectionId() pulumi.StringOutput { 144 return o.ApplyT(func(v LookupConnectionResult) string { return v.ConnectionId }).(pulumi.StringOutput) 145 } 146 147 // Description of the connection. 148 func (o LookupConnectionResultOutput) Description() pulumi.StringOutput { 149 return o.ApplyT(func(v LookupConnectionResult) string { return v.Description }).(pulumi.StringOutput) 150 } 151 152 // ID of the first device in the connection. 153 func (o LookupConnectionResultOutput) DeviceId() pulumi.StringOutput { 154 return o.ApplyT(func(v LookupConnectionResult) string { return v.DeviceId }).(pulumi.StringOutput) 155 } 156 157 func (o LookupConnectionResultOutput) GlobalNetworkId() pulumi.StringOutput { 158 return o.ApplyT(func(v LookupConnectionResult) string { return v.GlobalNetworkId }).(pulumi.StringOutput) 159 } 160 161 // The provider-assigned unique ID for this managed resource. 162 func (o LookupConnectionResultOutput) Id() pulumi.StringOutput { 163 return o.ApplyT(func(v LookupConnectionResult) string { return v.Id }).(pulumi.StringOutput) 164 } 165 166 // ID of the link for the first device. 167 func (o LookupConnectionResultOutput) LinkId() pulumi.StringOutput { 168 return o.ApplyT(func(v LookupConnectionResult) string { return v.LinkId }).(pulumi.StringOutput) 169 } 170 171 // Key-value tags for the connection. 172 func (o LookupConnectionResultOutput) Tags() pulumi.StringMapOutput { 173 return o.ApplyT(func(v LookupConnectionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 174 } 175 176 func init() { 177 pulumi.RegisterOutputType(LookupConnectionResultOutput{}) 178 }