- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateConnectionCommand
Creates a connection between two devices. The devices can be a physical or virtual appliance that connects to a third-party appliance in a VPC, or a physical appliance that connects to another physical appliance in an on-premises network.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { NetworkManagerClient, CreateConnectionCommand } from "@aws-sdk/client-networkmanager"; // ES Modules import
// const { NetworkManagerClient, CreateConnectionCommand } = require("@aws-sdk/client-networkmanager"); // CommonJS import
const client = new NetworkManagerClient(config);
const input = { // CreateConnectionRequest
GlobalNetworkId: "STRING_VALUE", // required
DeviceId: "STRING_VALUE", // required
ConnectedDeviceId: "STRING_VALUE", // required
LinkId: "STRING_VALUE",
ConnectedLinkId: "STRING_VALUE",
Description: "STRING_VALUE",
Tags: [ // TagList
{ // Tag
Key: "STRING_VALUE",
Value: "STRING_VALUE",
},
],
};
const command = new CreateConnectionCommand(input);
const response = await client.send(command);
// { // CreateConnectionResponse
// Connection: { // Connection
// ConnectionId: "STRING_VALUE",
// ConnectionArn: "STRING_VALUE",
// GlobalNetworkId: "STRING_VALUE",
// DeviceId: "STRING_VALUE",
// ConnectedDeviceId: "STRING_VALUE",
// LinkId: "STRING_VALUE",
// ConnectedLinkId: "STRING_VALUE",
// Description: "STRING_VALUE",
// CreatedAt: new Date("TIMESTAMP"),
// State: "PENDING" || "AVAILABLE" || "DELETING" || "UPDATING",
// Tags: [ // TagList
// { // Tag
// Key: "STRING_VALUE",
// Value: "STRING_VALUE",
// },
// ],
// },
// };
CreateConnectionCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ConnectedDeviceId Required | string | undefined | The ID of the second device in the connection. |
DeviceId Required | string | undefined | The ID of the first device in the connection. |
GlobalNetworkId Required | string | undefined | The ID of the global network. |
ConnectedLinkId | string | undefined | The ID of the link for the second device. |
Description | string | undefined | A description of the connection. Length Constraints: Maximum length of 256 characters. |
LinkId | string | undefined | The ID of the link for the first device. |
Tags | Tag[] | undefined | The tags to apply to the resource during creation. |
CreateConnectionCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Connection | Connection | undefined | Information about the connection. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ConflictException | client | There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state. |
InternalServerException | server | The request has failed due to an internal error. |
ServiceQuotaExceededException | client | A service limit was exceeded. |
ThrottlingException | client | The request was denied due to request throttling. |
ValidationException | client | The input fails to satisfy the constraints. |
NetworkManagerServiceException | Base exception class for all service exceptions from NetworkManager service. |