1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package ec2
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/ec2/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Modifies the specified Client VPN endpoint. Modifying the DNS server resets
15// existing client connections.
16func (c *Client) ModifyClientVpnEndpoint(ctx context.Context, params *ModifyClientVpnEndpointInput, optFns ...func(*Options)) (*ModifyClientVpnEndpointOutput, error) {
17	if params == nil {
18		params = &ModifyClientVpnEndpointInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "ModifyClientVpnEndpoint", params, optFns, addOperationModifyClientVpnEndpointMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*ModifyClientVpnEndpointOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type ModifyClientVpnEndpointInput struct {
32
33	// The ID of the Client VPN endpoint to modify.
34	//
35	// This member is required.
36	ClientVpnEndpointId *string
37
38	// The options for managing connection authorization for new client connections.
39	ClientConnectOptions *types.ClientConnectOptions
40
41	// Information about the client connection logging options. If you enable client
42	// connection logging, data about client connections is sent to a Cloudwatch Logs
43	// log stream. The following information is logged:
44	//
45	// * Client connection
46	// requests
47	//
48	// * Client connection results (successful and unsuccessful)
49	//
50	// * Reasons
51	// for unsuccessful client connection requests
52	//
53	// * Client connection termination
54	// time
55	ConnectionLogOptions *types.ConnectionLogOptions
56
57	// A brief description of the Client VPN endpoint.
58	Description *string
59
60	// Information about the DNS servers to be used by Client VPN connections. A Client
61	// VPN endpoint can have up to two DNS servers.
62	DnsServers *types.DnsServersOptionsModifyStructure
63
64	// Checks whether you have the required permissions for the action, without
65	// actually making the request, and provides an error response. If you have the
66	// required permissions, the error response is DryRunOperation. Otherwise, it is
67	// UnauthorizedOperation.
68	DryRun bool
69
70	// The IDs of one or more security groups to apply to the target network.
71	SecurityGroupIds []string
72
73	// Specify whether to enable the self-service portal for the Client VPN endpoint.
74	SelfServicePortal types.SelfServicePortal
75
76	// The ARN of the server certificate to be used. The server certificate must be
77	// provisioned in AWS Certificate Manager (ACM).
78	ServerCertificateArn *string
79
80	// Indicates whether the VPN is split-tunnel. For information about split-tunnel
81	// VPN endpoints, see Split-Tunnel AWS Client VPN Endpoint
82	// (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html)
83	// in the AWS Client VPN Administrator Guide.
84	SplitTunnel bool
85
86	// The ID of the VPC to associate with the Client VPN endpoint.
87	VpcId *string
88
89	// The port number to assign to the Client VPN endpoint for TCP and UDP traffic.
90	// Valid Values: 443 | 1194 Default Value: 443
91	VpnPort int32
92}
93
94type ModifyClientVpnEndpointOutput struct {
95
96	// Returns true if the request succeeds; otherwise, it returns an error.
97	Return bool
98
99	// Metadata pertaining to the operation's result.
100	ResultMetadata middleware.Metadata
101}
102
103func addOperationModifyClientVpnEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
104	err = stack.Serialize.Add(&awsEc2query_serializeOpModifyClientVpnEndpoint{}, middleware.After)
105	if err != nil {
106		return err
107	}
108	err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyClientVpnEndpoint{}, middleware.After)
109	if err != nil {
110		return err
111	}
112	if err = addSetLoggerMiddleware(stack, options); err != nil {
113		return err
114	}
115	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
116		return err
117	}
118	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
119		return err
120	}
121	if err = addResolveEndpointMiddleware(stack, options); err != nil {
122		return err
123	}
124	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
125		return err
126	}
127	if err = addRetryMiddlewares(stack, options); err != nil {
128		return err
129	}
130	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
131		return err
132	}
133	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
134		return err
135	}
136	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
137		return err
138	}
139	if err = addClientUserAgent(stack); err != nil {
140		return err
141	}
142	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
143		return err
144	}
145	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
146		return err
147	}
148	if err = addOpModifyClientVpnEndpointValidationMiddleware(stack); err != nil {
149		return err
150	}
151	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyClientVpnEndpoint(options.Region), middleware.Before); err != nil {
152		return err
153	}
154	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
155		return err
156	}
157	if err = addResponseErrorMiddleware(stack); err != nil {
158		return err
159	}
160	if err = addRequestResponseLogging(stack, options); err != nil {
161		return err
162	}
163	return nil
164}
165
166func newServiceMetadataMiddleware_opModifyClientVpnEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
167	return &awsmiddleware.RegisterServiceMetadata{
168		Region:        region,
169		ServiceID:     ServiceID,
170		SigningName:   "ec2",
171		OperationName: "ModifyClientVpnEndpoint",
172	}
173}
174