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
|
// Code generated by smithy-go-codegen DO NOT EDIT.
package ec2
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Modifies the customer gateway or the target gateway of an Amazon Web Services
// Site-to-Site VPN connection. To modify the target gateway, the following
// migration options are available:
// - An existing virtual private gateway to a new virtual private gateway
// - An existing virtual private gateway to a transit gateway
// - An existing transit gateway to a new transit gateway
// - An existing transit gateway to a virtual private gateway
//
// Before you perform the migration to the new gateway, you must configure the new
// gateway. Use CreateVpnGateway to create a virtual private gateway, or
// CreateTransitGateway to create a transit gateway. This step is required when you
// migrate from a virtual private gateway with static routes to a transit gateway.
// You must delete the static routes before you migrate to the new gateway. Keep a
// copy of the static route before you delete it. You will need to add back these
// routes to the transit gateway after the VPN connection migration is complete.
// After you migrate to the new gateway, you might need to modify your VPC route
// table. Use CreateRoute and DeleteRoute to make the changes described in Update
// VPC route tables (https://docs.aws.amazon.com/vpn/latest/s2svpn/modify-vpn-target.html#step-update-routing)
// in the Amazon Web Services Site-to-Site VPN User Guide. When the new gateway is
// a transit gateway, modify the transit gateway route table to allow traffic
// between the VPC and the Amazon Web Services Site-to-Site VPN connection. Use
// CreateTransitGatewayRoute to add the routes. If you deleted VPN static routes,
// you must add the static routes to the transit gateway route table. After you
// perform this operation, the VPN endpoint's IP addresses on the Amazon Web
// Services side and the tunnel options remain intact. Your Amazon Web Services
// Site-to-Site VPN connection will be temporarily unavailable for a brief period
// while we provision the new endpoints.
func (c *Client) ModifyVpnConnection(ctx context.Context, params *ModifyVpnConnectionInput, optFns ...func(*Options)) (*ModifyVpnConnectionOutput, error) {
if params == nil {
params = &ModifyVpnConnectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ModifyVpnConnection", params, optFns, c.addOperationModifyVpnConnectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ModifyVpnConnectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type ModifyVpnConnectionInput struct {
// The ID of the VPN connection.
//
// This member is required.
VpnConnectionId *string
// The ID of the customer gateway at your end of the VPN connection.
CustomerGatewayId *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
// The ID of the transit gateway.
TransitGatewayId *string
// The ID of the virtual private gateway at the Amazon Web Services side of the
// VPN connection.
VpnGatewayId *string
noSmithyDocumentSerde
}
type ModifyVpnConnectionOutput struct {
// Information about the VPN connection.
VpnConnection *types.VpnConnection
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationModifyVpnConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpnConnection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpnConnection{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpnConnection"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addOpModifyVpnConnectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpnConnection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opModifyVpnConnection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "ModifyVpnConnection",
}
}
|