-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_CreateCustomerGateway.go
166 lines (139 loc) · 5.66 KB
/
api_op_CreateCustomerGateway.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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Contains the parameters for CreateCustomerGateway.
type CreateCustomerGatewayInput struct {
_ struct{} `type:"structure"`
// For devices that support BGP, the customer gateway's BGP ASN.
//
// Default: 65000
//
// BgpAsn is a required field
BgpAsn *int64 `type:"integer" required:"true"`
// The Amazon Resource Name (ARN) for the customer gateway certificate.
CertificateArn *string `type:"string"`
// Checks whether you have the required permissions for the action, without
// actually making the request, and provides an error response. If you have
// the required permissions, the error response is DryRunOperation. Otherwise,
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
// The Internet-routable IP address for the customer gateway's outside interface.
// The address must be static.
PublicIp *string `locationName:"IpAddress" type:"string"`
// The type of VPN connection that this customer gateway supports (ipsec.1).
//
// Type is a required field
Type GatewayType `type:"string" required:"true" enum:"true"`
}
// String returns the string representation
func (s CreateCustomerGatewayInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateCustomerGatewayInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "CreateCustomerGatewayInput"}
if s.BgpAsn == nil {
invalidParams.Add(aws.NewErrParamRequired("BgpAsn"))
}
if len(s.Type) == 0 {
invalidParams.Add(aws.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the output of CreateCustomerGateway.
type CreateCustomerGatewayOutput struct {
_ struct{} `type:"structure"`
// Information about the customer gateway.
CustomerGateway *CustomerGateway `locationName:"customerGateway" type:"structure"`
}
// String returns the string representation
func (s CreateCustomerGatewayOutput) String() string {
return awsutil.Prettify(s)
}
const opCreateCustomerGateway = "CreateCustomerGateway"
// CreateCustomerGatewayRequest returns a request value for making API operation for
// Amazon Elastic Compute Cloud.
//
// Provides information to AWS about your VPN customer gateway device. The customer
// gateway is the appliance at your end of the VPN connection. (The device on
// the AWS side of the VPN connection is the virtual private gateway.) You must
// provide the Internet-routable IP address of the customer gateway's external
// interface. The IP address must be static and can be behind a device performing
// network address translation (NAT).
//
// For devices that use Border Gateway Protocol (BGP), you can also provide
// the device's BGP Autonomous System Number (ASN). You can use an existing
// ASN assigned to your network. If you don't have an ASN already, you can use
// a private ASN (in the 64512 - 65534 range).
//
// Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with
// the exception of 7224, which is reserved in the us-east-1 Region, and 9059,
// which is reserved in the eu-west-1 Region.
//
// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
// in the AWS Site-to-Site VPN User Guide.
//
// You cannot create more than one customer gateway with the same VPN type,
// IP address, and BGP ASN parameter values. If you run an identical request
// more than one time, the first request creates the customer gateway, and subsequent
// requests return information about the existing customer gateway. The subsequent
// requests do not create new customer gateway resources.
//
// // Example sending a request using CreateCustomerGatewayRequest.
// req := client.CreateCustomerGatewayRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway
func (c *Client) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) CreateCustomerGatewayRequest {
op := &aws.Operation{
Name: opCreateCustomerGateway,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateCustomerGatewayInput{}
}
req := c.newRequest(op, input, &CreateCustomerGatewayOutput{})
return CreateCustomerGatewayRequest{Request: req, Input: input, Copy: c.CreateCustomerGatewayRequest}
}
// CreateCustomerGatewayRequest is the request type for the
// CreateCustomerGateway API operation.
type CreateCustomerGatewayRequest struct {
*aws.Request
Input *CreateCustomerGatewayInput
Copy func(*CreateCustomerGatewayInput) CreateCustomerGatewayRequest
}
// Send marshals and sends the CreateCustomerGateway API request.
func (r CreateCustomerGatewayRequest) Send(ctx context.Context) (*CreateCustomerGatewayResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &CreateCustomerGatewayResponse{
CreateCustomerGatewayOutput: r.Request.Data.(*CreateCustomerGatewayOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// CreateCustomerGatewayResponse is the response type for the
// CreateCustomerGateway API operation.
type CreateCustomerGatewayResponse struct {
*CreateCustomerGatewayOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// CreateCustomerGateway request.
func (r *CreateCustomerGatewayResponse) SDKResponseMetdata() *aws.Response {
return r.response
}