/
getPeeringAttachment.go
204 lines (182 loc) · 7.11 KB
/
getPeeringAttachment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ec2transitgateway
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information on an EC2 Transit Gateway Peering Attachment.
//
// ## Example Usage
//
// ### By Filter
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2transitgateway.LookupPeeringAttachment(ctx, &ec2transitgateway.LookupPeeringAttachmentArgs{
// Filters: []ec2transitgateway.GetPeeringAttachmentFilter{
// {
// Name: "transit-gateway-attachment-id",
// Values: []string{
// "tgw-attach-12345678",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### By Identifier
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2transitgateway.LookupPeeringAttachment(ctx, &ec2transitgateway.LookupPeeringAttachmentArgs{
// Id: pulumi.StringRef("tgw-attach-12345678"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func LookupPeeringAttachment(ctx *pulumi.Context, args *LookupPeeringAttachmentArgs, opts ...pulumi.InvokeOption) (*LookupPeeringAttachmentResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupPeeringAttachmentResult
err := ctx.Invoke("aws:ec2transitgateway/getPeeringAttachment:getPeeringAttachment", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getPeeringAttachment.
type LookupPeeringAttachmentArgs struct {
// One or more configuration blocks containing name-values filters. Detailed below.
Filters []GetPeeringAttachmentFilter `pulumi:"filters"`
// Identifier of the EC2 Transit Gateway Peering Attachment.
Id *string `pulumi:"id"`
// Mapping of tags, each pair of which must exactly match
// a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
//
// More complex filters can be expressed using one or more `filter` sub-blocks,
// which take the following arguments:
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getPeeringAttachment.
type LookupPeeringAttachmentResult struct {
Filters []GetPeeringAttachmentFilter `pulumi:"filters"`
Id string `pulumi:"id"`
// Identifier of the peer AWS account
PeerAccountId string `pulumi:"peerAccountId"`
// Identifier of the peer AWS region
PeerRegion string `pulumi:"peerRegion"`
// Identifier of the peer EC2 Transit Gateway
PeerTransitGatewayId string `pulumi:"peerTransitGatewayId"`
State string `pulumi:"state"`
Tags map[string]string `pulumi:"tags"`
// Identifier of the local EC2 Transit Gateway
TransitGatewayId string `pulumi:"transitGatewayId"`
}
func LookupPeeringAttachmentOutput(ctx *pulumi.Context, args LookupPeeringAttachmentOutputArgs, opts ...pulumi.InvokeOption) LookupPeeringAttachmentResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupPeeringAttachmentResult, error) {
args := v.(LookupPeeringAttachmentArgs)
r, err := LookupPeeringAttachment(ctx, &args, opts...)
var s LookupPeeringAttachmentResult
if r != nil {
s = *r
}
return s, err
}).(LookupPeeringAttachmentResultOutput)
}
// A collection of arguments for invoking getPeeringAttachment.
type LookupPeeringAttachmentOutputArgs struct {
// One or more configuration blocks containing name-values filters. Detailed below.
Filters GetPeeringAttachmentFilterArrayInput `pulumi:"filters"`
// Identifier of the EC2 Transit Gateway Peering Attachment.
Id pulumi.StringPtrInput `pulumi:"id"`
// Mapping of tags, each pair of which must exactly match
// a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
//
// More complex filters can be expressed using one or more `filter` sub-blocks,
// which take the following arguments:
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupPeeringAttachmentOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPeeringAttachmentArgs)(nil)).Elem()
}
// A collection of values returned by getPeeringAttachment.
type LookupPeeringAttachmentResultOutput struct{ *pulumi.OutputState }
func (LookupPeeringAttachmentResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPeeringAttachmentResult)(nil)).Elem()
}
func (o LookupPeeringAttachmentResultOutput) ToLookupPeeringAttachmentResultOutput() LookupPeeringAttachmentResultOutput {
return o
}
func (o LookupPeeringAttachmentResultOutput) ToLookupPeeringAttachmentResultOutputWithContext(ctx context.Context) LookupPeeringAttachmentResultOutput {
return o
}
func (o LookupPeeringAttachmentResultOutput) Filters() GetPeeringAttachmentFilterArrayOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) []GetPeeringAttachmentFilter { return v.Filters }).(GetPeeringAttachmentFilterArrayOutput)
}
func (o LookupPeeringAttachmentResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) string { return v.Id }).(pulumi.StringOutput)
}
// Identifier of the peer AWS account
func (o LookupPeeringAttachmentResultOutput) PeerAccountId() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) string { return v.PeerAccountId }).(pulumi.StringOutput)
}
// Identifier of the peer AWS region
func (o LookupPeeringAttachmentResultOutput) PeerRegion() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) string { return v.PeerRegion }).(pulumi.StringOutput)
}
// Identifier of the peer EC2 Transit Gateway
func (o LookupPeeringAttachmentResultOutput) PeerTransitGatewayId() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) string { return v.PeerTransitGatewayId }).(pulumi.StringOutput)
}
func (o LookupPeeringAttachmentResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) string { return v.State }).(pulumi.StringOutput)
}
func (o LookupPeeringAttachmentResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// Identifier of the local EC2 Transit Gateway
func (o LookupPeeringAttachmentResultOutput) TransitGatewayId() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeeringAttachmentResult) string { return v.TransitGatewayId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupPeeringAttachmentResultOutput{})
}