-
Notifications
You must be signed in to change notification settings - Fork 151
/
getCustomerGateway.go
182 lines (159 loc) · 6.66 KB
/
getCustomerGateway.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get an existing AWS Customer Gateway.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := ec2.LookupCustomerGateway(ctx, &ec2.LookupCustomerGatewayArgs{
// Filters: []ec2.GetCustomerGatewayFilter{
// ec2.GetCustomerGatewayFilter{
// Name: "tag:Name",
// Values: []string{
// "foo-prod",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// main, err := ec2.NewVpnGateway(ctx, "main", &ec2.VpnGatewayArgs{
// VpcId: pulumi.Any(aws_vpc.Main.Id),
// AmazonSideAsn: pulumi.String("7224"),
// })
// if err != nil {
// return err
// }
// _, err = ec2.NewVpnConnection(ctx, "transit", &ec2.VpnConnectionArgs{
// VpnGatewayId: main.ID(),
// CustomerGatewayId: pulumi.String(foo.Id),
// Type: pulumi.String(foo.Type),
// StaticRoutesOnly: pulumi.Bool(false),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupCustomerGateway(ctx *pulumi.Context, args *LookupCustomerGatewayArgs, opts ...pulumi.InvokeOption) (*LookupCustomerGatewayResult, error) {
var rv LookupCustomerGatewayResult
err := ctx.Invoke("aws:ec2/getCustomerGateway:getCustomerGateway", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCustomerGateway.
type LookupCustomerGatewayArgs struct {
// One or more [name-value pairs][dcg-filters] to filter by.
Filters []GetCustomerGatewayFilter `pulumi:"filters"`
// The ID of the gateway.
Id *string `pulumi:"id"`
// Map of key-value pairs assigned to the gateway.
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getCustomerGateway.
type LookupCustomerGatewayResult struct {
// The ARN of the customer gateway.
Arn string `pulumi:"arn"`
// The gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
BgpAsn int `pulumi:"bgpAsn"`
// The Amazon Resource Name (ARN) for the customer gateway certificate.
CertificateArn string `pulumi:"certificateArn"`
// A name for the customer gateway device.
DeviceName string `pulumi:"deviceName"`
Filters []GetCustomerGatewayFilter `pulumi:"filters"`
Id string `pulumi:"id"`
// The IP address of the gateway's Internet-routable external interface.
IpAddress string `pulumi:"ipAddress"`
// Map of key-value pairs assigned to the gateway.
Tags map[string]string `pulumi:"tags"`
// The type of customer gateway. The only type AWS supports at this time is "ipsec.1".
Type string `pulumi:"type"`
}
func LookupCustomerGatewayOutput(ctx *pulumi.Context, args LookupCustomerGatewayOutputArgs, opts ...pulumi.InvokeOption) LookupCustomerGatewayResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupCustomerGatewayResult, error) {
args := v.(LookupCustomerGatewayArgs)
r, err := LookupCustomerGateway(ctx, &args, opts...)
return *r, err
}).(LookupCustomerGatewayResultOutput)
}
// A collection of arguments for invoking getCustomerGateway.
type LookupCustomerGatewayOutputArgs struct {
// One or more [name-value pairs][dcg-filters] to filter by.
Filters GetCustomerGatewayFilterArrayInput `pulumi:"filters"`
// The ID of the gateway.
Id pulumi.StringPtrInput `pulumi:"id"`
// Map of key-value pairs assigned to the gateway.
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupCustomerGatewayOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCustomerGatewayArgs)(nil)).Elem()
}
// A collection of values returned by getCustomerGateway.
type LookupCustomerGatewayResultOutput struct{ *pulumi.OutputState }
func (LookupCustomerGatewayResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCustomerGatewayResult)(nil)).Elem()
}
func (o LookupCustomerGatewayResultOutput) ToLookupCustomerGatewayResultOutput() LookupCustomerGatewayResultOutput {
return o
}
func (o LookupCustomerGatewayResultOutput) ToLookupCustomerGatewayResultOutputWithContext(ctx context.Context) LookupCustomerGatewayResultOutput {
return o
}
// The ARN of the customer gateway.
func (o LookupCustomerGatewayResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) string { return v.Arn }).(pulumi.StringOutput)
}
// The gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
func (o LookupCustomerGatewayResultOutput) BgpAsn() pulumi.IntOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) int { return v.BgpAsn }).(pulumi.IntOutput)
}
// The Amazon Resource Name (ARN) for the customer gateway certificate.
func (o LookupCustomerGatewayResultOutput) CertificateArn() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) string { return v.CertificateArn }).(pulumi.StringOutput)
}
// A name for the customer gateway device.
func (o LookupCustomerGatewayResultOutput) DeviceName() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) string { return v.DeviceName }).(pulumi.StringOutput)
}
func (o LookupCustomerGatewayResultOutput) Filters() GetCustomerGatewayFilterArrayOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) []GetCustomerGatewayFilter { return v.Filters }).(GetCustomerGatewayFilterArrayOutput)
}
func (o LookupCustomerGatewayResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) string { return v.Id }).(pulumi.StringOutput)
}
// The IP address of the gateway's Internet-routable external interface.
func (o LookupCustomerGatewayResultOutput) IpAddress() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) string { return v.IpAddress }).(pulumi.StringOutput)
}
// Map of key-value pairs assigned to the gateway.
func (o LookupCustomerGatewayResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The type of customer gateway. The only type AWS supports at this time is "ipsec.1".
func (o LookupCustomerGatewayResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomerGatewayResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupCustomerGatewayResultOutput{})
}