github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/getConnect.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 ec2transitgateway 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 // Get information on an EC2 Transit Gateway Connect. 15 // 16 // ## Example Usage 17 // 18 // ### By Filter 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := ec2transitgateway.LookupConnect(ctx, &ec2transitgateway.LookupConnectArgs{ 34 // Filters: []ec2transitgateway.GetConnectFilter{ 35 // { 36 // Name: "transport-transit-gateway-attachment-id", 37 // Values: []string{ 38 // "tgw-attach-12345678", 39 // }, 40 // }, 41 // }, 42 // }, nil) 43 // if err != nil { 44 // return err 45 // } 46 // return nil 47 // }) 48 // } 49 // 50 // ``` 51 // <!--End PulumiCodeChooser --> 52 // 53 // ### By Identifier 54 // 55 // <!--Start PulumiCodeChooser --> 56 // ```go 57 // package main 58 // 59 // import ( 60 // 61 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway" 62 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 63 // 64 // ) 65 // 66 // func main() { 67 // pulumi.Run(func(ctx *pulumi.Context) error { 68 // _, err := ec2transitgateway.LookupConnect(ctx, &ec2transitgateway.LookupConnectArgs{ 69 // TransitGatewayConnectId: pulumi.StringRef("tgw-attach-12345678"), 70 // }, nil) 71 // if err != nil { 72 // return err 73 // } 74 // return nil 75 // }) 76 // } 77 // 78 // ``` 79 // <!--End PulumiCodeChooser --> 80 func LookupConnect(ctx *pulumi.Context, args *LookupConnectArgs, opts ...pulumi.InvokeOption) (*LookupConnectResult, error) { 81 opts = internal.PkgInvokeDefaultOpts(opts) 82 var rv LookupConnectResult 83 err := ctx.Invoke("aws:ec2transitgateway/getConnect:getConnect", args, &rv, opts...) 84 if err != nil { 85 return nil, err 86 } 87 return &rv, nil 88 } 89 90 // A collection of arguments for invoking getConnect. 91 type LookupConnectArgs struct { 92 // One or more configuration blocks containing name-values filters. Detailed below. 93 Filters []GetConnectFilter `pulumi:"filters"` 94 // Key-value tags for the EC2 Transit Gateway Connect 95 Tags map[string]string `pulumi:"tags"` 96 // Identifier of the EC2 Transit Gateway Connect. 97 TransitGatewayConnectId *string `pulumi:"transitGatewayConnectId"` 98 } 99 100 // A collection of values returned by getConnect. 101 type LookupConnectResult struct { 102 Filters []GetConnectFilter `pulumi:"filters"` 103 // The provider-assigned unique ID for this managed resource. 104 Id string `pulumi:"id"` 105 // Tunnel protocol 106 Protocol string `pulumi:"protocol"` 107 // Key-value tags for the EC2 Transit Gateway Connect 108 Tags map[string]string `pulumi:"tags"` 109 TransitGatewayConnectId string `pulumi:"transitGatewayConnectId"` 110 // EC2 Transit Gateway identifier 111 TransitGatewayId string `pulumi:"transitGatewayId"` 112 // The underlaying VPC attachment 113 TransportAttachmentId string `pulumi:"transportAttachmentId"` 114 } 115 116 func LookupConnectOutput(ctx *pulumi.Context, args LookupConnectOutputArgs, opts ...pulumi.InvokeOption) LookupConnectResultOutput { 117 return pulumi.ToOutputWithContext(context.Background(), args). 118 ApplyT(func(v interface{}) (LookupConnectResult, error) { 119 args := v.(LookupConnectArgs) 120 r, err := LookupConnect(ctx, &args, opts...) 121 var s LookupConnectResult 122 if r != nil { 123 s = *r 124 } 125 return s, err 126 }).(LookupConnectResultOutput) 127 } 128 129 // A collection of arguments for invoking getConnect. 130 type LookupConnectOutputArgs struct { 131 // One or more configuration blocks containing name-values filters. Detailed below. 132 Filters GetConnectFilterArrayInput `pulumi:"filters"` 133 // Key-value tags for the EC2 Transit Gateway Connect 134 Tags pulumi.StringMapInput `pulumi:"tags"` 135 // Identifier of the EC2 Transit Gateway Connect. 136 TransitGatewayConnectId pulumi.StringPtrInput `pulumi:"transitGatewayConnectId"` 137 } 138 139 func (LookupConnectOutputArgs) ElementType() reflect.Type { 140 return reflect.TypeOf((*LookupConnectArgs)(nil)).Elem() 141 } 142 143 // A collection of values returned by getConnect. 144 type LookupConnectResultOutput struct{ *pulumi.OutputState } 145 146 func (LookupConnectResultOutput) ElementType() reflect.Type { 147 return reflect.TypeOf((*LookupConnectResult)(nil)).Elem() 148 } 149 150 func (o LookupConnectResultOutput) ToLookupConnectResultOutput() LookupConnectResultOutput { 151 return o 152 } 153 154 func (o LookupConnectResultOutput) ToLookupConnectResultOutputWithContext(ctx context.Context) LookupConnectResultOutput { 155 return o 156 } 157 158 func (o LookupConnectResultOutput) Filters() GetConnectFilterArrayOutput { 159 return o.ApplyT(func(v LookupConnectResult) []GetConnectFilter { return v.Filters }).(GetConnectFilterArrayOutput) 160 } 161 162 // The provider-assigned unique ID for this managed resource. 163 func (o LookupConnectResultOutput) Id() pulumi.StringOutput { 164 return o.ApplyT(func(v LookupConnectResult) string { return v.Id }).(pulumi.StringOutput) 165 } 166 167 // Tunnel protocol 168 func (o LookupConnectResultOutput) Protocol() pulumi.StringOutput { 169 return o.ApplyT(func(v LookupConnectResult) string { return v.Protocol }).(pulumi.StringOutput) 170 } 171 172 // Key-value tags for the EC2 Transit Gateway Connect 173 func (o LookupConnectResultOutput) Tags() pulumi.StringMapOutput { 174 return o.ApplyT(func(v LookupConnectResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 175 } 176 177 func (o LookupConnectResultOutput) TransitGatewayConnectId() pulumi.StringOutput { 178 return o.ApplyT(func(v LookupConnectResult) string { return v.TransitGatewayConnectId }).(pulumi.StringOutput) 179 } 180 181 // EC2 Transit Gateway identifier 182 func (o LookupConnectResultOutput) TransitGatewayId() pulumi.StringOutput { 183 return o.ApplyT(func(v LookupConnectResult) string { return v.TransitGatewayId }).(pulumi.StringOutput) 184 } 185 186 // The underlaying VPC attachment 187 func (o LookupConnectResultOutput) TransportAttachmentId() pulumi.StringOutput { 188 return o.ApplyT(func(v LookupConnectResult) string { return v.TransportAttachmentId }).(pulumi.StringOutput) 189 } 190 191 func init() { 192 pulumi.RegisterOutputType(LookupConnectResultOutput{}) 193 }