/
customerGateway.go
202 lines (170 loc) · 7.34 KB
/
customerGateway.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
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Specifies a customer gateway.
type CustomerGateway struct {
pulumi.CustomResourceState
// For devices that support BGP, the customer gateway's BGP ASN.
// Default: 65000
BgpAsn pulumi.IntPtrOutput `pulumi:"bgpAsn"`
BgpAsnExtended pulumi.Float64PtrOutput `pulumi:"bgpAsnExtended"`
CertificateArn pulumi.StringPtrOutput `pulumi:"certificateArn"`
CustomerGatewayId pulumi.StringOutput `pulumi:"customerGatewayId"`
// The name of customer gateway device.
DeviceName pulumi.StringPtrOutput `pulumi:"deviceName"`
// IPv4 address for the customer gateway device's outside interface. The address must be static.
IpAddress pulumi.StringOutput `pulumi:"ipAddress"`
// One or more tags for the customer gateway.
Tags aws.TagArrayOutput `pulumi:"tags"`
// The type of VPN connection that this customer gateway supports (``ipsec.1``).
Type pulumi.StringOutput `pulumi:"type"`
}
// NewCustomerGateway registers a new resource with the given unique name, arguments, and options.
func NewCustomerGateway(ctx *pulumi.Context,
name string, args *CustomerGatewayArgs, opts ...pulumi.ResourceOption) (*CustomerGateway, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.IpAddress == nil {
return nil, errors.New("invalid value for required argument 'IpAddress'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"bgpAsn",
"bgpAsnExtended",
"certificateArn",
"deviceName",
"ipAddress",
"type",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource CustomerGateway
err := ctx.RegisterResource("aws-native:ec2:CustomerGateway", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCustomerGateway gets an existing CustomerGateway resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCustomerGateway(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CustomerGatewayState, opts ...pulumi.ResourceOption) (*CustomerGateway, error) {
var resource CustomerGateway
err := ctx.ReadResource("aws-native:ec2:CustomerGateway", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CustomerGateway resources.
type customerGatewayState struct {
}
type CustomerGatewayState struct {
}
func (CustomerGatewayState) ElementType() reflect.Type {
return reflect.TypeOf((*customerGatewayState)(nil)).Elem()
}
type customerGatewayArgs struct {
// For devices that support BGP, the customer gateway's BGP ASN.
// Default: 65000
BgpAsn *int `pulumi:"bgpAsn"`
BgpAsnExtended *float64 `pulumi:"bgpAsnExtended"`
CertificateArn *string `pulumi:"certificateArn"`
// The name of customer gateway device.
DeviceName *string `pulumi:"deviceName"`
// IPv4 address for the customer gateway device's outside interface. The address must be static.
IpAddress string `pulumi:"ipAddress"`
// One or more tags for the customer gateway.
Tags []aws.Tag `pulumi:"tags"`
// The type of VPN connection that this customer gateway supports (``ipsec.1``).
Type string `pulumi:"type"`
}
// The set of arguments for constructing a CustomerGateway resource.
type CustomerGatewayArgs struct {
// For devices that support BGP, the customer gateway's BGP ASN.
// Default: 65000
BgpAsn pulumi.IntPtrInput
BgpAsnExtended pulumi.Float64PtrInput
CertificateArn pulumi.StringPtrInput
// The name of customer gateway device.
DeviceName pulumi.StringPtrInput
// IPv4 address for the customer gateway device's outside interface. The address must be static.
IpAddress pulumi.StringInput
// One or more tags for the customer gateway.
Tags aws.TagArrayInput
// The type of VPN connection that this customer gateway supports (``ipsec.1``).
Type pulumi.StringInput
}
func (CustomerGatewayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*customerGatewayArgs)(nil)).Elem()
}
type CustomerGatewayInput interface {
pulumi.Input
ToCustomerGatewayOutput() CustomerGatewayOutput
ToCustomerGatewayOutputWithContext(ctx context.Context) CustomerGatewayOutput
}
func (*CustomerGateway) ElementType() reflect.Type {
return reflect.TypeOf((**CustomerGateway)(nil)).Elem()
}
func (i *CustomerGateway) ToCustomerGatewayOutput() CustomerGatewayOutput {
return i.ToCustomerGatewayOutputWithContext(context.Background())
}
func (i *CustomerGateway) ToCustomerGatewayOutputWithContext(ctx context.Context) CustomerGatewayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CustomerGatewayOutput)
}
type CustomerGatewayOutput struct{ *pulumi.OutputState }
func (CustomerGatewayOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CustomerGateway)(nil)).Elem()
}
func (o CustomerGatewayOutput) ToCustomerGatewayOutput() CustomerGatewayOutput {
return o
}
func (o CustomerGatewayOutput) ToCustomerGatewayOutputWithContext(ctx context.Context) CustomerGatewayOutput {
return o
}
// For devices that support BGP, the customer gateway's BGP ASN.
//
// Default: 65000
func (o CustomerGatewayOutput) BgpAsn() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CustomerGateway) pulumi.IntPtrOutput { return v.BgpAsn }).(pulumi.IntPtrOutput)
}
func (o CustomerGatewayOutput) BgpAsnExtended() pulumi.Float64PtrOutput {
return o.ApplyT(func(v *CustomerGateway) pulumi.Float64PtrOutput { return v.BgpAsnExtended }).(pulumi.Float64PtrOutput)
}
func (o CustomerGatewayOutput) CertificateArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CustomerGateway) pulumi.StringPtrOutput { return v.CertificateArn }).(pulumi.StringPtrOutput)
}
func (o CustomerGatewayOutput) CustomerGatewayId() pulumi.StringOutput {
return o.ApplyT(func(v *CustomerGateway) pulumi.StringOutput { return v.CustomerGatewayId }).(pulumi.StringOutput)
}
// The name of customer gateway device.
func (o CustomerGatewayOutput) DeviceName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CustomerGateway) pulumi.StringPtrOutput { return v.DeviceName }).(pulumi.StringPtrOutput)
}
// IPv4 address for the customer gateway device's outside interface. The address must be static.
func (o CustomerGatewayOutput) IpAddress() pulumi.StringOutput {
return o.ApplyT(func(v *CustomerGateway) pulumi.StringOutput { return v.IpAddress }).(pulumi.StringOutput)
}
// One or more tags for the customer gateway.
func (o CustomerGatewayOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v *CustomerGateway) aws.TagArrayOutput { return v.Tags }).(aws.TagArrayOutput)
}
// The type of VPN connection that this customer gateway supports (“ipsec.1“).
func (o CustomerGatewayOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *CustomerGateway) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CustomerGatewayInput)(nil)).Elem(), &CustomerGateway{})
pulumi.RegisterOutputType(CustomerGatewayOutput{})
}