AssociateClientVpnTargetNetwork - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy.

If you specified a VPC when you created the Client VPN endpoint or if you have previous subnet associations, the specified subnet must be in the same VPC. To specify a subnet that's in a different VPC, you must first modify the Client VPN endpoint (ModifyClientVpnEndpoint) and change the VPC that's associated with it.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.


Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

Type: String

Required: No


The ID of the Client VPN endpoint.

Type: String

Required: Yes


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.

Type: Boolean

Required: No


The ID of the subnet to associate with the Client VPN endpoint.

Type: String

Required: Yes

Response Elements

The following elements are returned by the service.


The unique ID of the target network association.

Type: String


The ID of the request.

Type: String


The current state of the target network association.

Type: AssociationStatus object


For information about the errors that are common to all actions, see Common client error codes.



This example associates a subnet with a Client VPN endpoint.

Sample Request &ClientVpnEndpointId=cvpn-endpoint-00c5d11fc4EXAMPLE &SubnetId=subnet-057fa0918fEXAMPLE &AUTHPARAMS

Sample Response

<AssociateClientVpnTargetNetworkResponse xmlns=""> <requestId>7d1f819b-7f2a-4f81-aabf-81caeEXAMPLE</requestId> <status> <code>associating</code> </status> <associationId>cvpn-assoc-0822b0983cEXAMPLE</associationId> </AssociateClientVpnTargetNetworkRespons>

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: