github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/directconnect/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 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 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/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.LookupConnection(ctx, &directconnect.LookupConnectionArgs{ 32 // Name: "tf-dx-connection", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func LookupConnection(ctx *pulumi.Context, args *LookupConnectionArgs, opts ...pulumi.InvokeOption) (*LookupConnectionResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv LookupConnectionResult 46 err := ctx.Invoke("aws:directconnect/getConnection:getConnection", 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 getConnection. 54 type LookupConnectionArgs struct { 55 // Name of the connection to retrieve. 56 Name string `pulumi:"name"` 57 // Map of tags for the resource. 58 Tags map[string]string `pulumi:"tags"` 59 } 60 61 // A collection of values returned by getConnection. 62 type LookupConnectionResult struct { 63 // ARN of the connection. 64 Arn string `pulumi:"arn"` 65 // Direct Connect endpoint on which the physical connection terminates. 66 AwsDevice string `pulumi:"awsDevice"` 67 // Bandwidth of the connection. 68 Bandwidth string `pulumi:"bandwidth"` 69 // The provider-assigned unique ID for this managed resource. 70 Id string `pulumi:"id"` 71 // AWS Direct Connect location where the connection is located. 72 Location string `pulumi:"location"` 73 Name string `pulumi:"name"` 74 // ID of the AWS account that owns the connection. 75 OwnerAccountId string `pulumi:"ownerAccountId"` 76 // The name of the AWS Direct Connect service provider associated with the connection. 77 PartnerName string `pulumi:"partnerName"` 78 // Name of the service provider associated with the connection. 79 ProviderName string `pulumi:"providerName"` 80 // Map of tags for the resource. 81 Tags map[string]string `pulumi:"tags"` 82 // The VLAN ID. 83 VlanId int `pulumi:"vlanId"` 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 // Name of the connection to retrieve. 102 Name pulumi.StringInput `pulumi:"name"` 103 // Map of tags for the resource. 104 Tags pulumi.StringMapInput `pulumi:"tags"` 105 } 106 107 func (LookupConnectionOutputArgs) ElementType() reflect.Type { 108 return reflect.TypeOf((*LookupConnectionArgs)(nil)).Elem() 109 } 110 111 // A collection of values returned by getConnection. 112 type LookupConnectionResultOutput struct{ *pulumi.OutputState } 113 114 func (LookupConnectionResultOutput) ElementType() reflect.Type { 115 return reflect.TypeOf((*LookupConnectionResult)(nil)).Elem() 116 } 117 118 func (o LookupConnectionResultOutput) ToLookupConnectionResultOutput() LookupConnectionResultOutput { 119 return o 120 } 121 122 func (o LookupConnectionResultOutput) ToLookupConnectionResultOutputWithContext(ctx context.Context) LookupConnectionResultOutput { 123 return o 124 } 125 126 // ARN of the connection. 127 func (o LookupConnectionResultOutput) Arn() pulumi.StringOutput { 128 return o.ApplyT(func(v LookupConnectionResult) string { return v.Arn }).(pulumi.StringOutput) 129 } 130 131 // Direct Connect endpoint on which the physical connection terminates. 132 func (o LookupConnectionResultOutput) AwsDevice() pulumi.StringOutput { 133 return o.ApplyT(func(v LookupConnectionResult) string { return v.AwsDevice }).(pulumi.StringOutput) 134 } 135 136 // Bandwidth of the connection. 137 func (o LookupConnectionResultOutput) Bandwidth() pulumi.StringOutput { 138 return o.ApplyT(func(v LookupConnectionResult) string { return v.Bandwidth }).(pulumi.StringOutput) 139 } 140 141 // The provider-assigned unique ID for this managed resource. 142 func (o LookupConnectionResultOutput) Id() pulumi.StringOutput { 143 return o.ApplyT(func(v LookupConnectionResult) string { return v.Id }).(pulumi.StringOutput) 144 } 145 146 // AWS Direct Connect location where the connection is located. 147 func (o LookupConnectionResultOutput) Location() pulumi.StringOutput { 148 return o.ApplyT(func(v LookupConnectionResult) string { return v.Location }).(pulumi.StringOutput) 149 } 150 151 func (o LookupConnectionResultOutput) Name() pulumi.StringOutput { 152 return o.ApplyT(func(v LookupConnectionResult) string { return v.Name }).(pulumi.StringOutput) 153 } 154 155 // ID of the AWS account that owns the connection. 156 func (o LookupConnectionResultOutput) OwnerAccountId() pulumi.StringOutput { 157 return o.ApplyT(func(v LookupConnectionResult) string { return v.OwnerAccountId }).(pulumi.StringOutput) 158 } 159 160 // The name of the AWS Direct Connect service provider associated with the connection. 161 func (o LookupConnectionResultOutput) PartnerName() pulumi.StringOutput { 162 return o.ApplyT(func(v LookupConnectionResult) string { return v.PartnerName }).(pulumi.StringOutput) 163 } 164 165 // Name of the service provider associated with the connection. 166 func (o LookupConnectionResultOutput) ProviderName() pulumi.StringOutput { 167 return o.ApplyT(func(v LookupConnectionResult) string { return v.ProviderName }).(pulumi.StringOutput) 168 } 169 170 // Map of tags for the resource. 171 func (o LookupConnectionResultOutput) Tags() pulumi.StringMapOutput { 172 return o.ApplyT(func(v LookupConnectionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 173 } 174 175 // The VLAN ID. 176 func (o LookupConnectionResultOutput) VlanId() pulumi.IntOutput { 177 return o.ApplyT(func(v LookupConnectionResult) int { return v.VlanId }).(pulumi.IntOutput) 178 } 179 180 func init() { 181 pulumi.RegisterOutputType(LookupConnectionResultOutput{}) 182 }