Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Class CreateDirectConnectGatewayAssociationCommandProtected

Creates an association between a Direct Connect gateway and a virtual private gateway. The virtual private gateway must be attached to a VPC and must not be associated with another Direct Connect gateway.

Example

Use a bare-bones client and the command you need to make an API call.

import { DirectConnectClient, CreateDirectConnectGatewayAssociationCommand } from "@aws-sdk/client-direct-connect"; // ES Modules import
// const { DirectConnectClient, CreateDirectConnectGatewayAssociationCommand } = require("@aws-sdk/client-direct-connect"); // CommonJS import
const client = new DirectConnectClient(config);
const input = { // CreateDirectConnectGatewayAssociationRequest
directConnectGatewayId: "STRING_VALUE", // required
gatewayId: "STRING_VALUE",
addAllowedPrefixesToDirectConnectGateway: [ // RouteFilterPrefixList
{ // RouteFilterPrefix
cidr: "STRING_VALUE",
},
],
virtualGatewayId: "STRING_VALUE",
};
const command = new CreateDirectConnectGatewayAssociationCommand(input);
const response = await client.send(command);
// { // CreateDirectConnectGatewayAssociationResult
// directConnectGatewayAssociation: { // DirectConnectGatewayAssociation
// directConnectGatewayId: "STRING_VALUE",
// directConnectGatewayOwnerAccount: "STRING_VALUE",
// associationState: "associating" || "associated" || "disassociating" || "disassociated" || "updating",
// stateChangeError: "STRING_VALUE",
// associatedGateway: { // AssociatedGateway
// id: "STRING_VALUE",
// type: "virtualPrivateGateway" || "transitGateway",
// ownerAccount: "STRING_VALUE",
// region: "STRING_VALUE",
// },
// associationId: "STRING_VALUE",
// allowedPrefixesToDirectConnectGateway: [ // RouteFilterPrefixList
// { // RouteFilterPrefix
// cidr: "STRING_VALUE",
// },
// ],
// virtualGatewayId: "STRING_VALUE",
// virtualGatewayRegion: "STRING_VALUE",
// virtualGatewayOwnerAccount: "STRING_VALUE",
// },
// };

Param

CreateDirectConnectGatewayAssociationCommandInput

Returns

CreateDirectConnectGatewayAssociationCommandOutput

See

Throws

DirectConnectClientException (client fault)

One or more parameters are not valid.

Throws

DirectConnectServerException (server fault)

A server-side error occurred.

Throws

DirectConnectServiceException

Base exception class for all service exceptions from DirectConnect service.

Hierarchy

Constructors

Properties

Methods