Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

AWS Direct Connect examples using AWS CLI

フォーカスモード
AWS Direct Connect examples using AWS CLI - AWS Command Line Interface

このドキュメントはバージョン 1 の AWS CLI のみを対象としています。AWS CLI のバージョン 2 に関連するドキュメントについては、バージョン 2 用ユーザーガイドを参照してください。

このドキュメントはバージョン 1 の AWS CLI のみを対象としています。AWS CLI のバージョン 2 に関連するドキュメントについては、バージョン 2 用ユーザーガイドを参照してください。

次のコード例では、AWS Direct Connect で AWS Command Line Interface を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています。

アクションはより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。

各例には完全なソースコードへのリンクが含まれており、コードの設定方法と実行方法に関する手順を確認できます。

トピック

アクション

次のコード例は、accept-direct-connect-gateway-association-proposal を使用する方法を示しています。

AWS CLI

ゲートウェイの関連付けの提案を承諾するには

以下の accept-direct-connect-gateway-association-proposal は指定された提案を承諾します。

aws directconnect accept-direct-connect-gateway-association-proposal \ --direct-connect-gateway-id 11460968-4ac1-4fd3-bdb2-00599EXAMPLE \ --proposal-id cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE \ --associated-gateway-owner-account 111122223333 { "directConnectGatewayAssociation": { "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "associationState": "associating", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "associationId": "6441f8bf-5917-4279-ade1-9708bEXAMPLE", "allowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.1.0/30" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Accepting or Rejecting a Transit Gateway Association Proposal」を参照してください。

次のコード例は、accept-direct-connect-gateway-association-proposal を使用する方法を示しています。

AWS CLI

ゲートウェイの関連付けの提案を承諾するには

以下の accept-direct-connect-gateway-association-proposal は指定された提案を承諾します。

aws directconnect accept-direct-connect-gateway-association-proposal \ --direct-connect-gateway-id 11460968-4ac1-4fd3-bdb2-00599EXAMPLE \ --proposal-id cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE \ --associated-gateway-owner-account 111122223333 { "directConnectGatewayAssociation": { "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "associationState": "associating", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "associationId": "6441f8bf-5917-4279-ade1-9708bEXAMPLE", "allowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.1.0/30" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Accepting or Rejecting a Transit Gateway Association Proposal」を参照してください。

次のコード例は、allocate-connection-on-interconnect を使用する方法を示しています。

AWS CLI

相互接続上にホスト接続を作成するには

次の allocate-connection-on-interconnect コマンドは、相互接続上にホスト接続を作成します。

aws directconnect allocate-connection-on-interconnect --bandwidth 500Mbps --connection-name mydcinterconnect --owner-account 123456789012 --interconnect-id dxcon-fgktov66 --vlan 101

出力:

{ "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }

次のコード例は、allocate-connection-on-interconnect を使用する方法を示しています。

AWS CLI

相互接続上にホスト接続を作成するには

次の allocate-connection-on-interconnect コマンドは、相互接続上にホスト接続を作成します。

aws directconnect allocate-connection-on-interconnect --bandwidth 500Mbps --connection-name mydcinterconnect --owner-account 123456789012 --interconnect-id dxcon-fgktov66 --vlan 101

出力:

{ "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }

次の例は、allocate-hosted-connection を使用する方法を説明しています。

AWS CLI

相互接続上にホスト接続を作成するには

次の allocate-hosted-connection の例では、指定された相互接続上にホスト接続を作成します。

aws directconnect allocate-hosted-connection \ --bandwidth 500Mbps \ --connection-name mydcinterconnect \ --owner-account 123456789012 -connection-id dxcon-fgktov66 -vlan 101

出力:

{ "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AllocateHostedConnection」を参照してください。

次の例は、allocate-hosted-connection を使用する方法を説明しています。

AWS CLI

相互接続上にホスト接続を作成するには

次の allocate-hosted-connection の例では、指定された相互接続上にホスト接続を作成します。

aws directconnect allocate-hosted-connection \ --bandwidth 500Mbps \ --connection-name mydcinterconnect \ --owner-account 123456789012 -connection-id dxcon-fgktov66 -vlan 101

出力:

{ "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AllocateHostedConnection」を参照してください。

次のコード例は、allocate-private-virtual-interface を使用する方法を示しています。

AWS CLI

プライベート仮想インターフェイスをプロビジョニングするには

次の allocate-private-virtual-interface コマンドは、別の顧客が所有できるようにプライベート仮想インターフェイスをプロビジョニングします。

aws directconnect allocate-private-virtual-interface --connection-id dxcon-ffjrkx17 --owner-account 123456789012 --new-private-virtual-interface-allocation virtualInterfaceName=PrivateVirtualInterface,vlan=1000,asn=65000,authKey=asdf34example,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30

出力:

{ "virtualInterfaceState": "confirming", "asn": 65000, "vlan": 1000, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fgy8orxu", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <logical_connection id=\"dxvif-fgy8orxu\">\n <vlan>1000</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }

次のコード例は、allocate-private-virtual-interface を使用する方法を示しています。

AWS CLI

プライベート仮想インターフェイスをプロビジョニングするには

次の allocate-private-virtual-interface コマンドは、別の顧客が所有できるようにプライベート仮想インターフェイスをプロビジョニングします。

aws directconnect allocate-private-virtual-interface --connection-id dxcon-ffjrkx17 --owner-account 123456789012 --new-private-virtual-interface-allocation virtualInterfaceName=PrivateVirtualInterface,vlan=1000,asn=65000,authKey=asdf34example,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30

出力:

{ "virtualInterfaceState": "confirming", "asn": 65000, "vlan": 1000, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fgy8orxu", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <logical_connection id=\"dxvif-fgy8orxu\">\n <vlan>1000</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }

次のコード例は、allocate-public-virtual-interface を使用する方法を示しています。

AWS CLI

パブリック仮想インターフェイスをプロビジョニングするには

次の allocate-public-virtual-interface コマンドは、別の顧客が所有できるようにパブリック仮想インターフェイスをプロビジョニングします。

aws directconnect allocate-public-virtual-interface --connection-id dxcon-ffjrkx17 --owner-account 123456789012 --new-public-virtual-interface-allocation virtualInterfaceName=PublicVirtualInterface,vlan=2000,asn=65000,authKey=asdf34example,amazonAddress=203.0.113.1/30,customerAddress=203.0.113.2/30,routeFilterPrefixes=[{cidr=203.0.113.0/30},{cidr=203.0.113.4/30}]

出力:

{ "virtualInterfaceState": "confirming", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fg9xo9vp", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.0/30" }, { "cidr": "203.0.113.4/30" } ], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fg9xo9vp\">\n <vlan>2000</vlan>\n <customer_address>203.0.113.2/30</customer_address>\n <amazon_address>203.0.113.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>public</connection_type>\n</logical_connection>\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" }

次のコード例は、allocate-public-virtual-interface を使用する方法を示しています。

AWS CLI

パブリック仮想インターフェイスをプロビジョニングするには

次の allocate-public-virtual-interface コマンドは、別の顧客が所有できるようにパブリック仮想インターフェイスをプロビジョニングします。

aws directconnect allocate-public-virtual-interface --connection-id dxcon-ffjrkx17 --owner-account 123456789012 --new-public-virtual-interface-allocation virtualInterfaceName=PublicVirtualInterface,vlan=2000,asn=65000,authKey=asdf34example,amazonAddress=203.0.113.1/30,customerAddress=203.0.113.2/30,routeFilterPrefixes=[{cidr=203.0.113.0/30},{cidr=203.0.113.4/30}]

出力:

{ "virtualInterfaceState": "confirming", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fg9xo9vp", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.0/30" }, { "cidr": "203.0.113.4/30" } ], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fg9xo9vp\">\n <vlan>2000</vlan>\n <customer_address>203.0.113.2/30</customer_address>\n <amazon_address>203.0.113.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>public</connection_type>\n</logical_connection>\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" }

次の例は、allocate-transit-virtual-interface を使用する方法を説明しています。

AWS CLI

指定された AWS アカウントが所有できるようにトランジット仮想インターフェイスをプロビジョニングするには

次の allocate-transit-virtual-interface の例では、指定されたアカウントのトランジット仮想インターフェイスをプロビジョニングします。

aws directconnect allocate-transit-virtual-interface \ --connection-id dxlag-fEXAMPLE \ --owner-account 123456789012 \ --new-transit-virtual-interface-allocation "virtualInterfaceName=Example Transit Virtual Interface,vlan=126,asn=65110,mtu=1500,authKey=0xzxgA9YoW9h58u8SEXAMPLE,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,addressFamily=ipv4,tags=[{key=Tag,value=Example}]"

出力:

{ "virtualInterface": { "ownerAccount": "123456789012", "virtualInterfaceId": "dxvif-fEXAMPLE", "location": "loc1", "connectionId": "dxlag-fEXAMPLE", "virtualInterfaceType": "transit", "virtualInterfaceName": "Example Transit Virtual Interface", "vlan": 126, "asn": 65110, "amazonSideAsn": 7224, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "addressFamily": "ipv4", "virtualInterfaceState": "confirming", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>126</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65110</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SEXAMPLE</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", "mtu": 1500, "jumboFrameCapable": true, "virtualGatewayId": "", "directConnectGatewayId": "", "routeFilterPrefixes": [], "bgpPeers": [ { "bgpPeerId": "dxpeer-fEXAMPLE", "asn": 65110, "authKey": "0xzxgA9YoW9h58u8EXAMPLE", "addressFamily": "ipv4", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "bgpPeerState": "pending", "bgpStatus": "down", "awsDeviceV2": "loc1-26wz6vEXAMPLE" } ], "region": "sa-east-1", "awsDeviceV2": "loc1-26wz6vEXAMPLE", "tags": [ { "key": "Tag", "value": "Example" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Creating a Hosted Transit Virtual Interface」を参照してください。

次の例は、allocate-transit-virtual-interface を使用する方法を説明しています。

AWS CLI

指定された AWS アカウントが所有できるようにトランジット仮想インターフェイスをプロビジョニングするには

次の allocate-transit-virtual-interface の例では、指定されたアカウントのトランジット仮想インターフェイスをプロビジョニングします。

aws directconnect allocate-transit-virtual-interface \ --connection-id dxlag-fEXAMPLE \ --owner-account 123456789012 \ --new-transit-virtual-interface-allocation "virtualInterfaceName=Example Transit Virtual Interface,vlan=126,asn=65110,mtu=1500,authKey=0xzxgA9YoW9h58u8SEXAMPLE,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,addressFamily=ipv4,tags=[{key=Tag,value=Example}]"

出力:

{ "virtualInterface": { "ownerAccount": "123456789012", "virtualInterfaceId": "dxvif-fEXAMPLE", "location": "loc1", "connectionId": "dxlag-fEXAMPLE", "virtualInterfaceType": "transit", "virtualInterfaceName": "Example Transit Virtual Interface", "vlan": 126, "asn": 65110, "amazonSideAsn": 7224, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "addressFamily": "ipv4", "virtualInterfaceState": "confirming", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>126</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65110</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SEXAMPLE</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", "mtu": 1500, "jumboFrameCapable": true, "virtualGatewayId": "", "directConnectGatewayId": "", "routeFilterPrefixes": [], "bgpPeers": [ { "bgpPeerId": "dxpeer-fEXAMPLE", "asn": 65110, "authKey": "0xzxgA9YoW9h58u8EXAMPLE", "addressFamily": "ipv4", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "bgpPeerState": "pending", "bgpStatus": "down", "awsDeviceV2": "loc1-26wz6vEXAMPLE" } ], "region": "sa-east-1", "awsDeviceV2": "loc1-26wz6vEXAMPLE", "tags": [ { "key": "Tag", "value": "Example" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Creating a Hosted Transit Virtual Interface」を参照してください。

次の例は、associate-connection-with-lag を使用する方法を説明しています。

AWS CLI

接続を LAG と関連付けるには

次の例では、指定した接続を指定した LAG と関連付けます。

コマンド:

aws directconnect associate-connection-with-lag --lag-id dxlag-fhccu14t --connection-id dxcon-fg9607vm

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "lagId": "dxlag-fhccu14t", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Con2ForLag", "region": "us-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AssociateConnectionWithLag」を参照してください。

次の例は、associate-connection-with-lag を使用する方法を説明しています。

AWS CLI

接続を LAG と関連付けるには

次の例では、指定した接続を指定した LAG と関連付けます。

コマンド:

aws directconnect associate-connection-with-lag --lag-id dxlag-fhccu14t --connection-id dxcon-fg9607vm

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "lagId": "dxlag-fhccu14t", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Con2ForLag", "region": "us-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AssociateConnectionWithLag」を参照してください。

次の例は、associate-hosted-connection を使用する方法を説明しています。

AWS CLI

ホスト接続を LAG と関連付けるには

次の例では、指定したホスト接続を指定した LAG と関連付けます。

コマンド:

aws directconnect associate-hosted-connection --parent-connection-id dxlag-fhccu14t --connection-id dxcon-fg9607vm

出力:

{ "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "lagId": "dxlag-fhccu14t", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AssociateHostedConnection」を参照してください。

次の例は、associate-hosted-connection を使用する方法を説明しています。

AWS CLI

ホスト接続を LAG と関連付けるには

次の例では、指定したホスト接続を指定した LAG と関連付けます。

コマンド:

aws directconnect associate-hosted-connection --parent-connection-id dxlag-fhccu14t --connection-id dxcon-fg9607vm

出力:

{ "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "lagId": "dxlag-fhccu14t", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AssociateHostedConnection」を参照してください。

次の例は、associate-virtual-interface を使用する方法を説明しています。

AWS CLI

仮想インターフェイスを接続と関連付けるには

次の例では、指定した仮想インターフェイスを指定した LAG と関連付けます。または、仮想インターフェイスを接続と関連付けるには、--connection-id の AWS Direct Connect 接続の ID を指定します (例: dxcon-ffnikghc)。

コマンド:

aws directconnect associate-virtual-interface --connection-id dxlag-ffjhj9lx --virtual-interface-id dxvif-fgputw0j

出力:

{ "virtualInterfaceState": "pending", "asn": 65000, "vlan": 123, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxlag-ffjhj9lx", "addressFamily": "ipv4", "virtualGatewayId": "vgw-38e90b51", "virtualInterfaceId": "dxvif-fgputw0j", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "routeFilterPrefixes": [], "location": "CSVA1", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "bgpPeerState": "deleting", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "bgpPeerState": "pending", "amazonAddress": "169.254.255.1/30", "asn": 65000 } ], "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fgputw0j\">\n <vlan>123</vlan>\n <customer_address>169.254.255.2/30</customer_address>\n <amazon_address>169.254.255.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>0x123pK5_VBqv.UQ3kJ4123_</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "VIF1A" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AssociateVirtualInterface」を参照してください。

次の例は、associate-virtual-interface を使用する方法を説明しています。

AWS CLI

仮想インターフェイスを接続と関連付けるには

次の例では、指定した仮想インターフェイスを指定した LAG と関連付けます。または、仮想インターフェイスを接続と関連付けるには、--connection-id の AWS Direct Connect 接続の ID を指定します (例: dxcon-ffnikghc)。

コマンド:

aws directconnect associate-virtual-interface --connection-id dxlag-ffjhj9lx --virtual-interface-id dxvif-fgputw0j

出力:

{ "virtualInterfaceState": "pending", "asn": 65000, "vlan": 123, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxlag-ffjhj9lx", "addressFamily": "ipv4", "virtualGatewayId": "vgw-38e90b51", "virtualInterfaceId": "dxvif-fgputw0j", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "routeFilterPrefixes": [], "location": "CSVA1", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "bgpPeerState": "deleting", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "bgpPeerState": "pending", "amazonAddress": "169.254.255.1/30", "asn": 65000 } ], "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fgputw0j\">\n <vlan>123</vlan>\n <customer_address>169.254.255.2/30</customer_address>\n <amazon_address>169.254.255.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>0x123pK5_VBqv.UQ3kJ4123_</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "VIF1A" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「AssociateVirtualInterface」を参照してください。

次の例は、confirm-connection を使用する方法を説明しています。

AWS CLI

相互接続上にホスト接続が作成されていることを確認するには

次の confirm-connection コマンドは、相互接続上にホスト接続が作成されていることを確認します。

aws directconnect confirm-connection --connection-id dxcon-fg2wi7hy

出力:

{ "connectionState": "pending" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「ConfirmConnection」を参照してください。

次の例は、confirm-connection を使用する方法を説明しています。

AWS CLI

相互接続上にホスト接続が作成されていることを確認するには

次の confirm-connection コマンドは、相互接続上にホスト接続が作成されていることを確認します。

aws directconnect confirm-connection --connection-id dxcon-fg2wi7hy

出力:

{ "connectionState": "pending" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「ConfirmConnection」を参照してください。

次の例は、confirm-private-virtual-interface を使用する方法を説明しています。

AWS CLI

プライベート仮想インターフェイスの所有権を承諾するには

次の confirm-private-virtual-interface コマンドは、別の顧客が作成したプライベート仮想インターフェイスの所有権を承諾します。

aws directconnect confirm-private-virtual-interface --virtual-interface-id dxvif-fgy8orxu --virtual-gateway-id vgw-e4a47df9

出力:

{ "virtualInterfaceState": "pending" }

次の例は、confirm-private-virtual-interface を使用する方法を説明しています。

AWS CLI

プライベート仮想インターフェイスの所有権を承諾するには

次の confirm-private-virtual-interface コマンドは、別の顧客が作成したプライベート仮想インターフェイスの所有権を承諾します。

aws directconnect confirm-private-virtual-interface --virtual-interface-id dxvif-fgy8orxu --virtual-gateway-id vgw-e4a47df9

出力:

{ "virtualInterfaceState": "pending" }

次の例は、confirm-public-virtual-interface を使用する方法を説明しています。

AWS CLI

パブリック仮想インターフェイスの所有権を承諾するには

次の confirm-public-virtual-interface コマンドは、別の顧客が作成したパブリック仮想インターフェイスの所有権を承諾します。

aws directconnect confirm-public-virtual-interface --virtual-interface-id dxvif-fg9xo9vp

出力:

{ "virtualInterfaceState": "verifying" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「ConfirmPublicVirtualInterface」を参照してください。

次の例は、confirm-public-virtual-interface を使用する方法を説明しています。

AWS CLI

パブリック仮想インターフェイスの所有権を承諾するには

次の confirm-public-virtual-interface コマンドは、別の顧客が作成したパブリック仮想インターフェイスの所有権を承諾します。

aws directconnect confirm-public-virtual-interface --virtual-interface-id dxvif-fg9xo9vp

出力:

{ "virtualInterfaceState": "verifying" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「ConfirmPublicVirtualInterface」を参照してください。

次の例は、confirm-transit-virtual-interface を使用する方法を説明しています。

AWS CLI

トランジット仮想インターフェイスの所有権を承諾するには

次の confirm-transit-virtual-interface コマンドは、別の顧客が作成したトランジット仮想インターフェイスの所有権を承諾します。

aws directconnect confirm-transit-virtual-interface \ --virtual-interface-id dxvif-fEXAMPLE \ --direct-connect-gateway-id 4112ccf9-25e9-4111-8237-b6c5dEXAMPLE

出力:

{ "virtualInterfaceState": "pending" }

詳細については、「AWS Direct Connect ユーザーガイド」の「Accepting a Hosted Virtual Interface」を参照してください。

次の例は、confirm-transit-virtual-interface を使用する方法を説明しています。

AWS CLI

トランジット仮想インターフェイスの所有権を承諾するには

次の confirm-transit-virtual-interface コマンドは、別の顧客が作成したトランジット仮想インターフェイスの所有権を承諾します。

aws directconnect confirm-transit-virtual-interface \ --virtual-interface-id dxvif-fEXAMPLE \ --direct-connect-gateway-id 4112ccf9-25e9-4111-8237-b6c5dEXAMPLE

出力:

{ "virtualInterfaceState": "pending" }

詳細については、「AWS Direct Connect ユーザーガイド」の「Accepting a Hosted Virtual Interface」を参照してください。

次の例は、create-bgp-peer を使用する方法を説明しています。

AWS CLI

IPv6 BGP ピアリングセッションを作成するには

次の例では、プライベート仮想インターフェイス dxvif-fg1vuj3d に IPv6 BGP ピアリングセッションを作成します。ピア IPv6 アドレスは Amazon によって自動的に割り当てられます。

コマンド:

aws directconnect create-bgp-peer --virtual-interface-id dxvif-fg1vuj3d --new-bgp-peer asn=64600,addressFamily=ipv6

出力:

{ "virtualInterface": { "virtualInterfaceState": "available", "asn": 65000, "vlan": 125, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "addressFamily": "ipv4", "virtualGatewayId": "vgw-f9eb0c90", "virtualInterfaceId": "dxvif-fg1vuj3d", "authKey": "0xC_ukbCerl6EYA0example", "routeFilterPrefixes": [], "location": "EqDC2", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0xC_ukbCerl6EYA0uexample", "bgpPeerState": "available", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "2001:db8:1100:2f0:0:1:9cb4:4216/125", "addressFamily": "ipv6", "authKey": "0xS27kAIU_VHPjjAexample", "bgpPeerState": "pending", "amazonAddress": "2001:db8:1100:2f0:0:1:9cb4:4211/125", "asn": 64600 } ], "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fg1vuj3d\">\n <vlan>125</vlan>\n <customer_address>169.254.255.2/30</customer_address>\n <amazon_address>169.254.255.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>0xC_ukbCerl6EYA0uexample</bgp_auth_key>\n <ipv6_customer_address>2001:db8:1100:2f0:0:1:9cb4:4216/125</ipv6_customer_address>\n <ipv6_amazon_address>2001:db8:1100:2f0:0:1:9cb4:4211/125</ipv6_amazon_address>\n <ipv6_bgp_asn>64600</ipv6_bgp_asn>\n <ipv6_bgp_auth_key>0xS27kAIU_VHPjjAexample</ipv6_bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "Test" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateBgpPeer」を参照してください。

次の例は、create-bgp-peer を使用する方法を説明しています。

AWS CLI

IPv6 BGP ピアリングセッションを作成するには

次の例では、プライベート仮想インターフェイス dxvif-fg1vuj3d に IPv6 BGP ピアリングセッションを作成します。ピア IPv6 アドレスは Amazon によって自動的に割り当てられます。

コマンド:

aws directconnect create-bgp-peer --virtual-interface-id dxvif-fg1vuj3d --new-bgp-peer asn=64600,addressFamily=ipv6

出力:

{ "virtualInterface": { "virtualInterfaceState": "available", "asn": 65000, "vlan": 125, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "addressFamily": "ipv4", "virtualGatewayId": "vgw-f9eb0c90", "virtualInterfaceId": "dxvif-fg1vuj3d", "authKey": "0xC_ukbCerl6EYA0example", "routeFilterPrefixes": [], "location": "EqDC2", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0xC_ukbCerl6EYA0uexample", "bgpPeerState": "available", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "2001:db8:1100:2f0:0:1:9cb4:4216/125", "addressFamily": "ipv6", "authKey": "0xS27kAIU_VHPjjAexample", "bgpPeerState": "pending", "amazonAddress": "2001:db8:1100:2f0:0:1:9cb4:4211/125", "asn": 64600 } ], "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fg1vuj3d\">\n <vlan>125</vlan>\n <customer_address>169.254.255.2/30</customer_address>\n <amazon_address>169.254.255.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>0xC_ukbCerl6EYA0uexample</bgp_auth_key>\n <ipv6_customer_address>2001:db8:1100:2f0:0:1:9cb4:4216/125</ipv6_customer_address>\n <ipv6_amazon_address>2001:db8:1100:2f0:0:1:9cb4:4211/125</ipv6_amazon_address>\n <ipv6_bgp_asn>64600</ipv6_bgp_asn>\n <ipv6_bgp_auth_key>0xS27kAIU_VHPjjAexample</ipv6_bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "Test" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateBgpPeer」を参照してください。

次の例は、create-connection を使用する方法を説明しています。

AWS CLI

ネットワークから AWS Direct Connect ロケーションへの接続を作成するには

次の create-connection コマンドは、ネットワークから AWS Direct Connect ロケーションへの接続を作成します。

aws directconnect create-connection --location TIVIT --bandwidth 1Gbps --connection-name "Connection to AWS"

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg31dyv6", "connectionState": "requested", "bandwidth": "1Gbps", "location": "TIVIT", "connectionName": "Connection to AWS", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateConnection」を参照してください。

次の例は、create-connection を使用する方法を説明しています。

AWS CLI

ネットワークから AWS Direct Connect ロケーションへの接続を作成するには

次の create-connection コマンドは、ネットワークから AWS Direct Connect ロケーションへの接続を作成します。

aws directconnect create-connection --location TIVIT --bandwidth 1Gbps --connection-name "Connection to AWS"

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg31dyv6", "connectionState": "requested", "bandwidth": "1Gbps", "location": "TIVIT", "connectionName": "Connection to AWS", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateConnection」を参照してください。

次のコード例は、create-direct-connect-gateway-association-proposal を使用する方法を示しています。

AWS CLI

指定した Transit Gateway を、指定した Direct Connect ゲートウェイと関連付けるための提案を作成するには

次の create-direct-connect-gateway-association-proposal では、指定した Transit Gateway を、指定した Direct Connect ゲートウェイと関連付けるための提案を作成します。

aws directconnect create-direct-connect-gateway-association-proposal \ --direct-connect-gateway-id 11460968-4ac1-4fd3-bdb2-00599EXAMPLE \ --direct-connect-gateway-owner-account 111122223333 \ --gateway-id tgw-02f776b1a7EXAMPLE \ --add-allowed-prefixes-to-direct-connect-gateway cidr=192.168.1.0/30

出力:

{ "directConnectGatewayAssociationProposal": { "proposalId": "cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE", "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "proposalState": "requested", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "requestedAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.1.0/30" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Creating a Transit Gateway Association Proposal」を参照してください。

次のコード例は、create-direct-connect-gateway-association-proposal を使用する方法を示しています。

AWS CLI

指定した Transit Gateway を、指定した Direct Connect ゲートウェイと関連付けるための提案を作成するには

次の create-direct-connect-gateway-association-proposal では、指定した Transit Gateway を、指定した Direct Connect ゲートウェイと関連付けるための提案を作成します。

aws directconnect create-direct-connect-gateway-association-proposal \ --direct-connect-gateway-id 11460968-4ac1-4fd3-bdb2-00599EXAMPLE \ --direct-connect-gateway-owner-account 111122223333 \ --gateway-id tgw-02f776b1a7EXAMPLE \ --add-allowed-prefixes-to-direct-connect-gateway cidr=192.168.1.0/30

出力:

{ "directConnectGatewayAssociationProposal": { "proposalId": "cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE", "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "proposalState": "requested", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "requestedAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.1.0/30" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Creating a Transit Gateway Association Proposal」を参照してください。

次の例は、create-direct-connect-gateway-association を使用する方法を説明しています。

AWS CLI

仮想プライベートインターフェイスを Direct Connect ゲートウェイと関連付けるには

次の例では、仮想プライベートゲートウェイ vgw-6efe725e を Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample と関連付けます。仮想プライベートゲートウェイがあるリージョンで、コマンドを実行する必要があります。

コマンド:

aws directconnect create-direct-connect-gateway-association --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample --virtual-gateway-id vgw-6efe725e

出力:

{ "directConnectGatewayAssociation": { "associationState": "associating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" } }

次の例は、create-direct-connect-gateway-association を使用する方法を説明しています。

AWS CLI

仮想プライベートインターフェイスを Direct Connect ゲートウェイと関連付けるには

次の例では、仮想プライベートゲートウェイ vgw-6efe725e を Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample と関連付けます。仮想プライベートゲートウェイがあるリージョンで、コマンドを実行する必要があります。

コマンド:

aws directconnect create-direct-connect-gateway-association --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample --virtual-gateway-id vgw-6efe725e

出力:

{ "directConnectGatewayAssociation": { "associationState": "associating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" } }

次のコード例は、create-direct-connect-gateway を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイを作成するには

次の例では、DxGateway1 という名前の Direct Connect ゲートウェイを作成します。

コマンド:

aws directconnect create-direct-connect-gateway --direct-connect-gateway-name "DxGateway1"

出力:

{ "directConnectGateway": { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bdexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "available" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDirectConnectGateway」を参照してください。

次のコード例は、create-direct-connect-gateway を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイを作成するには

次の例では、DxGateway1 という名前の Direct Connect ゲートウェイを作成します。

コマンド:

aws directconnect create-direct-connect-gateway --direct-connect-gateway-name "DxGateway1"

出力:

{ "directConnectGateway": { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bdexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "available" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDirectConnectGateway」を参照してください。

次の例は、create-interconnect を使用する方法を説明しています。

AWS CLI

パートナーのネットワークと AWS 間の相互接続を作成するには

次の create-interconnect コマンドは、AWS Direct Connect パートナーのネットワークと特定の AWS Direct Connect ロケーションの間に相互接続を作成します。

aws directconnect create-interconnect --interconnect-name "1G Interconnect to AWS" --bandwidth 1Gbps --location TIVIT

出力:

{ "region": "sa-east-1", "bandwidth": "1Gbps", "location": "TIVIT", "interconnectName": "1G Interconnect to AWS", "interconnectId": "dxcon-fgktov66", "interconnectState": "requested" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateInterconnect」を参照してください。

次の例は、create-interconnect を使用する方法を説明しています。

AWS CLI

パートナーのネットワークと AWS 間の相互接続を作成するには

次の create-interconnect コマンドは、AWS Direct Connect パートナーのネットワークと特定の AWS Direct Connect ロケーションの間に相互接続を作成します。

aws directconnect create-interconnect --interconnect-name "1G Interconnect to AWS" --bandwidth 1Gbps --location TIVIT

出力:

{ "region": "sa-east-1", "bandwidth": "1Gbps", "location": "TIVIT", "interconnectName": "1G Interconnect to AWS", "interconnectId": "dxcon-fgktov66", "interconnectState": "requested" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateInterconnect」を参照してください。

次の例は、create-lag を使用する方法を説明しています。

AWS CLI

新しい接続で LAG を作成するには

次の例では、LAG を作成し、帯域幅が 1 Gbps の 2 つの新しい AWS Direct Connect 接続を LAG 用にリクエストします。

コマンド:

aws directconnect create-lag --location CSVA1 --number-of-connections 2 --connections-bandwidth 1Gbps --lag-name 1GBLag

出力:

{ "awsDevice": "CSVA1-23u8tlpaz8iks", "numberOfConnections": 2, "lagState": "pending", "ownerAccount": "123456789012", "lagName": "1GBLag", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-ffqr6x5q", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 1 for Lag dxlag-ffjhj9lx", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fflqyj95", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 2 for Lag dxlag-ffjhj9lx", "region": "us-east-1" } ], "lagId": "dxlag-ffjhj9lx", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "CSVA1" }

既存の接続を使用して LAG を作成するには

次の例では、アカウント内の既存の接続から LAG を作成し、既存の接続と同じ帯域幅とロケーションを持つ 2 番目の新しい接続を LAG 用にリクエストします。

コマンド:

aws directconnect create-lag --location EqDC2 --number-of-connections 2 --connections-bandwidth 1Gbps --lag-name 2ConnLAG --connection-id dxcon-fgk145dr

出力:

{ "awsDevice": "EqDC2-4h6ce2r1bes6", "numberOfConnections": 2, "lagState": "pending", "ownerAccount": "123456789012", "lagName": "2ConnLAG", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-fh6ljcvo", "lagId": "dxlag-fhccu14t", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Requested Connection 1 for Lag dxlag-fhccu14t", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fgk145dr", "lagId": "dxlag-fhccu14t", "connectionState": "down", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "VAConn1", "region": "us-east-1" } ], "lagId": "dxlag-fhccu14t", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "EqDC2" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateLag」を参照してください。

次の例は、create-lag を使用する方法を説明しています。

AWS CLI

新しい接続で LAG を作成するには

次の例では、LAG を作成し、帯域幅が 1 Gbps の 2 つの新しい AWS Direct Connect 接続を LAG 用にリクエストします。

コマンド:

aws directconnect create-lag --location CSVA1 --number-of-connections 2 --connections-bandwidth 1Gbps --lag-name 1GBLag

出力:

{ "awsDevice": "CSVA1-23u8tlpaz8iks", "numberOfConnections": 2, "lagState": "pending", "ownerAccount": "123456789012", "lagName": "1GBLag", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-ffqr6x5q", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 1 for Lag dxlag-ffjhj9lx", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fflqyj95", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 2 for Lag dxlag-ffjhj9lx", "region": "us-east-1" } ], "lagId": "dxlag-ffjhj9lx", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "CSVA1" }

既存の接続を使用して LAG を作成するには

次の例では、アカウント内の既存の接続から LAG を作成し、既存の接続と同じ帯域幅とロケーションを持つ 2 番目の新しい接続を LAG 用にリクエストします。

コマンド:

aws directconnect create-lag --location EqDC2 --number-of-connections 2 --connections-bandwidth 1Gbps --lag-name 2ConnLAG --connection-id dxcon-fgk145dr

出力:

{ "awsDevice": "EqDC2-4h6ce2r1bes6", "numberOfConnections": 2, "lagState": "pending", "ownerAccount": "123456789012", "lagName": "2ConnLAG", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-fh6ljcvo", "lagId": "dxlag-fhccu14t", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Requested Connection 1 for Lag dxlag-fhccu14t", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fgk145dr", "lagId": "dxlag-fhccu14t", "connectionState": "down", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "VAConn1", "region": "us-east-1" } ], "lagId": "dxlag-fhccu14t", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "EqDC2" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateLag」を参照してください。

次のコード例は、create-private-virtual-interface を使用する方法を示しています。

AWS CLI

プライベート仮想インターフェイスを作成するには

次の create-private-virtual-interface コマンドは、プライベート仮想インターフェイスを作成します。

aws directconnect create-private-virtual-interface --connection-id dxcon-ffjrkx17 --new-private-virtual-interface virtualInterfaceName=PrivateVirtualInterface,vlan=101,asn=65000,authKey=asdf34example,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,virtualGatewayId=vgw-aba37db6

出力:

{ "virtualInterfaceState": "pending", "asn": 65000, "vlan": 101, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "vgw-aba37db6", "virtualInterfaceId": "dxvif-ffhhk74f", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-ffhhk74f\">\n <vlan>101</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreatePrivateVirtualInterface」を参照してください。

次のコード例は、create-private-virtual-interface を使用する方法を示しています。

AWS CLI

プライベート仮想インターフェイスを作成するには

次の create-private-virtual-interface コマンドは、プライベート仮想インターフェイスを作成します。

aws directconnect create-private-virtual-interface --connection-id dxcon-ffjrkx17 --new-private-virtual-interface virtualInterfaceName=PrivateVirtualInterface,vlan=101,asn=65000,authKey=asdf34example,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,virtualGatewayId=vgw-aba37db6

出力:

{ "virtualInterfaceState": "pending", "asn": 65000, "vlan": 101, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "vgw-aba37db6", "virtualInterfaceId": "dxvif-ffhhk74f", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-ffhhk74f\">\n <vlan>101</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreatePrivateVirtualInterface」を参照してください。

次のコード例は、create-public-virtual-interface を使用する方法を示しています。

AWS CLI

パブリック仮想インターフェイスを作成するには

次の create-public-virtual-interface コマンドは、パブリック仮想インターフェイスを作成します。

aws directconnect create-public-virtual-interface --connection-id dxcon-ffjrkx17 --new-public-virtual-interface virtualInterfaceName=PublicVirtualInterface,vlan=2000,asn=65000,authKey=asdf34example,amazonAddress=203.0.113.1/30,customerAddress=203.0.113.2/30,routeFilterPrefixes=[{cidr=203.0.113.0/30},{cidr=203.0.113.4/30}]

出力:

{ "virtualInterfaceState": "verifying", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fgh0hcrk", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.0/30" }, { "cidr": "203.0.113.4/30" } ], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fgh0hcrk\">\n <vlan>2000</vlan>\n <customer_address>203.0.113.2/30</customer_address>\n <amazon_address>203.0.113.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>public</connection_type>\n</logical_connection>\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreatePublicVirtualInterface」を参照してください。

次のコード例は、create-public-virtual-interface を使用する方法を示しています。

AWS CLI

パブリック仮想インターフェイスを作成するには

次の create-public-virtual-interface コマンドは、パブリック仮想インターフェイスを作成します。

aws directconnect create-public-virtual-interface --connection-id dxcon-ffjrkx17 --new-public-virtual-interface virtualInterfaceName=PublicVirtualInterface,vlan=2000,asn=65000,authKey=asdf34example,amazonAddress=203.0.113.1/30,customerAddress=203.0.113.2/30,routeFilterPrefixes=[{cidr=203.0.113.0/30},{cidr=203.0.113.4/30}]

出力:

{ "virtualInterfaceState": "verifying", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fgh0hcrk", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.0/30" }, { "cidr": "203.0.113.4/30" } ], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fgh0hcrk\">\n <vlan>2000</vlan>\n <customer_address>203.0.113.2/30</customer_address>\n <amazon_address>203.0.113.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>public</connection_type>\n</logical_connection>\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreatePublicVirtualInterface」を参照してください。

次のコード例は、create-transit-virtual-interface を使用する方法を示しています。

AWS CLI

トランジット仮想インターフェイスを作成するには

次の create-transit-virtual-interface の例では、指定した接続用にトランジット仮想インターフェイスを作成します。

aws directconnect create-transit-virtual-interface \ --connection-id dxlag-fEXAMPLE \ --new-transit-virtual-interface "virtualInterfaceName=Example Transit Virtual Interface,vlan=126,asn=65110,mtu=1500,authKey=0xzxgA9YoW9h58u8SvEXAMPLE,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,addressFamily=ipv4,directConnectGatewayId=8384da05-13ce-4a91-aada-5a1baEXAMPLE,tags=[{key=Tag,value=Example}]"

出力:

{ "virtualInterface": { "ownerAccount": "1111222233333", "virtualInterfaceId": "dxvif-fEXAMPLE", "location": "loc1", "connectionId": "dxlag-fEXAMPLE", "virtualInterfaceType": "transit", "virtualInterfaceName": "Example Transit Virtual Interface", "vlan": 126, "asn": 65110, "amazonSideAsn": 4200000000, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "addressFamily": "ipv4", "virtualInterfaceState": "pending", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>126</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65110</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SvOmXRTw</bgp_auth_key>\n <amazon_bgp_asn>4200000000</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", "mtu": 1500, "jumboFrameCapable": true, "virtualGatewayId": "", "directConnectGatewayId": "8384da05-13ce-4a91-aada-5a1baEXAMPLE", "routeFilterPrefixes": [], "bgpPeers": [ { "bgpPeerId": "dxpeer-EXAMPLE", "asn": 65110, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "addressFamily": "ipv4", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "bgpPeerState": "pending", "bgpStatus": "down", "awsDeviceV2": "loc1-26wz6vEXAMPLE" } ], "region": "sa-east-1", "awsDeviceV2": "loc1-26wz6vEXAMPLE", "tags": [ { "key": "Tag", "value": "Example" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Creating a Transit Virtual Interface to the Direct Connect Gateway」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateTransitVirtualInterface」を参照してください。

次のコード例は、create-transit-virtual-interface を使用する方法を示しています。

AWS CLI

トランジット仮想インターフェイスを作成するには

次の create-transit-virtual-interface の例では、指定した接続用にトランジット仮想インターフェイスを作成します。

aws directconnect create-transit-virtual-interface \ --connection-id dxlag-fEXAMPLE \ --new-transit-virtual-interface "virtualInterfaceName=Example Transit Virtual Interface,vlan=126,asn=65110,mtu=1500,authKey=0xzxgA9YoW9h58u8SvEXAMPLE,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,addressFamily=ipv4,directConnectGatewayId=8384da05-13ce-4a91-aada-5a1baEXAMPLE,tags=[{key=Tag,value=Example}]"

出力:

{ "virtualInterface": { "ownerAccount": "1111222233333", "virtualInterfaceId": "dxvif-fEXAMPLE", "location": "loc1", "connectionId": "dxlag-fEXAMPLE", "virtualInterfaceType": "transit", "virtualInterfaceName": "Example Transit Virtual Interface", "vlan": 126, "asn": 65110, "amazonSideAsn": 4200000000, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "addressFamily": "ipv4", "virtualInterfaceState": "pending", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>126</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65110</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SvOmXRTw</bgp_auth_key>\n <amazon_bgp_asn>4200000000</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", "mtu": 1500, "jumboFrameCapable": true, "virtualGatewayId": "", "directConnectGatewayId": "8384da05-13ce-4a91-aada-5a1baEXAMPLE", "routeFilterPrefixes": [], "bgpPeers": [ { "bgpPeerId": "dxpeer-EXAMPLE", "asn": 65110, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "addressFamily": "ipv4", "amazonAddress": "192.168.1.1/30", "customerAddress": "192.168.1.2/30", "bgpPeerState": "pending", "bgpStatus": "down", "awsDeviceV2": "loc1-26wz6vEXAMPLE" } ], "region": "sa-east-1", "awsDeviceV2": "loc1-26wz6vEXAMPLE", "tags": [ { "key": "Tag", "value": "Example" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Creating a Transit Virtual Interface to the Direct Connect Gateway」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateTransitVirtualInterface」を参照してください。

次のコード例は、delete-bgp-peer を使用する方法を示しています。

AWS CLI

仮想インターフェイスから BGP ピアを削除するには

次の例では、仮想インターフェイス dxvif-fg1vuj3d から IPv6 BGP ピアを削除します。

コマンド:

aws directconnect delete-bgp-peer --virtual-interface-id dxvif-fg1vuj3d --asn 64600 --customer-address 2001:db8:1100:2f0:0:1:9cb4:4216/125

出力:

{ "virtualInterface": { "virtualInterfaceState": "available", "asn": 65000, "vlan": 125, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "addressFamily": "ipv4", "virtualGatewayId": "vgw-f9eb0c90", "virtualInterfaceId": "dxvif-fg1vuj3d", "authKey": "0xC_ukbCerl6EYA0example", "routeFilterPrefixes": [], "location": "EqDC2", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0xC_ukbCerl6EYA0uexample", "bgpPeerState": "available", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "2001:db8:1100:2f0:0:1:9cb4:4216/125", "addressFamily": "ipv6", "authKey": "0xS27kAIU_VHPjjAexample", "bgpPeerState": "deleting", "amazonAddress": "2001:db8:1100:2f0:0:1:9cb4:4211/125", "asn": 64600 } ], "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fg1vuj3d\">\n <vlan>125</vlan>\n <customer_address>169.254.255.2/30</customer_address>\n <amazon_address>169.254.255.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>0xC_ukbCerl6EYA0example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "Test" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteBgpPeer」を参照してください。

次のコード例は、delete-bgp-peer を使用する方法を示しています。

AWS CLI

仮想インターフェイスから BGP ピアを削除するには

次の例では、仮想インターフェイス dxvif-fg1vuj3d から IPv6 BGP ピアを削除します。

コマンド:

aws directconnect delete-bgp-peer --virtual-interface-id dxvif-fg1vuj3d --asn 64600 --customer-address 2001:db8:1100:2f0:0:1:9cb4:4216/125

出力:

{ "virtualInterface": { "virtualInterfaceState": "available", "asn": 65000, "vlan": 125, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "addressFamily": "ipv4", "virtualGatewayId": "vgw-f9eb0c90", "virtualInterfaceId": "dxvif-fg1vuj3d", "authKey": "0xC_ukbCerl6EYA0example", "routeFilterPrefixes": [], "location": "EqDC2", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0xC_ukbCerl6EYA0uexample", "bgpPeerState": "available", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "2001:db8:1100:2f0:0:1:9cb4:4216/125", "addressFamily": "ipv6", "authKey": "0xS27kAIU_VHPjjAexample", "bgpPeerState": "deleting", "amazonAddress": "2001:db8:1100:2f0:0:1:9cb4:4211/125", "asn": 64600 } ], "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fg1vuj3d\">\n <vlan>125</vlan>\n <customer_address>169.254.255.2/30</customer_address>\n <amazon_address>169.254.255.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>0xC_ukbCerl6EYA0example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "Test" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteBgpPeer」を参照してください。

次の例は、delete-connection を使用する方法を説明しています。

AWS CLI

接続を削除するには

次の delete-connection コマンドは、指定した接続を削除します。

aws directconnect delete-connection --connection-id dxcon-fg31dyv6

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg31dyv6", "connectionState": "deleted", "bandwidth": "1Gbps", "location": "TIVIT", "connectionName": "Connection to AWS", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteConnection」を参照してください。

次の例は、delete-connection を使用する方法を説明しています。

AWS CLI

接続を削除するには

次の delete-connection コマンドは、指定した接続を削除します。

aws directconnect delete-connection --connection-id dxcon-fg31dyv6

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg31dyv6", "connectionState": "deleted", "bandwidth": "1Gbps", "location": "TIVIT", "connectionName": "Connection to AWS", "region": "sa-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteConnection」を参照してください。

次のコード例は、delete-direct-connect-gateway-association を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けを削除するには

次の delete-direct-connect-gateway-association の例では、指定された関連付け ID を持つ Transit Gateway との Direct Connect ゲートウェイの関連付けを削除します。

aws directconnect delete-direct-connect-gateway-association --association-id be85116d-46eb-4b43-a27a-da0c2ad648de

出力:

{ "directConnectGatewayAssociation": { "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPlE", "directConnectGatewayOwnerAccount": "123456789012", "associationState": "disassociating", "associatedGateway": { "id": "tgw-095b3b0b54EXAMPLE", "type": "transitGateway", "ownerAccount": "123456789012", "region": "us-east-1" }, "associationId": " be85116d-46eb-4b43-a27a-da0c2ad648deEXAMPLE ", "allowedPrefixesToDirectConnectGateway": [ { "cidr": "192.0.1.0/28" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Associating and Disassociating Transit Gateways」を参照してください。

次のコード例は、delete-direct-connect-gateway-association を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けを削除するには

次の delete-direct-connect-gateway-association の例では、指定された関連付け ID を持つ Transit Gateway との Direct Connect ゲートウェイの関連付けを削除します。

aws directconnect delete-direct-connect-gateway-association --association-id be85116d-46eb-4b43-a27a-da0c2ad648de

出力:

{ "directConnectGatewayAssociation": { "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPlE", "directConnectGatewayOwnerAccount": "123456789012", "associationState": "disassociating", "associatedGateway": { "id": "tgw-095b3b0b54EXAMPLE", "type": "transitGateway", "ownerAccount": "123456789012", "region": "us-east-1" }, "associationId": " be85116d-46eb-4b43-a27a-da0c2ad648deEXAMPLE ", "allowedPrefixesToDirectConnectGateway": [ { "cidr": "192.0.1.0/28" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Associating and Disassociating Transit Gateways」を参照してください。

次のコード例は、delete-direct-connect-gateway を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイを削除するには

次の例では、Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample を削除します。

コマンド:

aws directconnect delete-direct-connect-gateway --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample

出力:

{ "directConnectGateway": { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "deleting" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDirectConnectGateway」を参照してください。

次のコード例は、delete-direct-connect-gateway を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイを削除するには

次の例では、Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample を削除します。

コマンド:

aws directconnect delete-direct-connect-gateway --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample

出力:

{ "directConnectGateway": { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "deleting" } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDirectConnectGateway」を参照してください。

次の例は、delete-interconnect を使用する方法を説明しています。

AWS CLI

相互接続を削除するには

次の delete-interconnect コマンドは、指定した相互接続を削除します。

aws directconnect delete-interconnect --interconnect-id dxcon-fgktov66

出力:

{ "interconnectState": "deleted" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteInterconnect」を参照してください。

次の例は、delete-interconnect を使用する方法を説明しています。

AWS CLI

相互接続を削除するには

次の delete-interconnect コマンドは、指定した相互接続を削除します。

aws directconnect delete-interconnect --interconnect-id dxcon-fgktov66

出力:

{ "interconnectState": "deleted" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteInterconnect」を参照してください。

次の例は、delete-lag を使用する方法を説明しています。

AWS CLI

LAG を削除するには

次の例では、指定した LAG を削除します。

コマンド:

aws directconnect delete-lag --lag-id dxlag-ffrhowd9

出力:

{ "awsDevice": "EqDC2-4h6ce2r1bes6", "numberOfConnections": 0, "lagState": "deleted", "ownerAccount": "123456789012", "lagName": "TestLAG", "connections": [], "lagId": "dxlag-ffrhowd9", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "EqDC2" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteLag」を参照してください。

次の例は、delete-lag を使用する方法を説明しています。

AWS CLI

LAG を削除するには

次の例では、指定した LAG を削除します。

コマンド:

aws directconnect delete-lag --lag-id dxlag-ffrhowd9

出力:

{ "awsDevice": "EqDC2-4h6ce2r1bes6", "numberOfConnections": 0, "lagState": "deleted", "ownerAccount": "123456789012", "lagName": "TestLAG", "connections": [], "lagId": "dxlag-ffrhowd9", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "EqDC2" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteLag」を参照してください。

次の例は、delete-virtual-interface を使用する方法を説明しています。

AWS CLI

仮想インターフェイスを削除するには

次の delete-virtual-interface コマンドは、指定した仮想インターフェイスを削除します。

aws directconnect delete-virtual-interface --virtual-interface-id dxvif-ffhhk74f

出力:

{ "virtualInterfaceState": "deleting" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteVirtualInterface」を参照してください。

次の例は、delete-virtual-interface を使用する方法を説明しています。

AWS CLI

仮想インターフェイスを削除するには

次の delete-virtual-interface コマンドは、指定した仮想インターフェイスを削除します。

aws directconnect delete-virtual-interface --virtual-interface-id dxvif-ffhhk74f

出力:

{ "virtualInterfaceState": "deleting" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteVirtualInterface」を参照してください。

次の例は、describe-connection-loa を使用する方法を説明しています。

AWS CLI

Linux または Mac OS X を使用して接続用の LOA-CFA を記述するには

次の例では、接続 dxcon-fh6ayh1d 用の LOA-CFA を記述します。LOA-CFA の内容は base64 でエンコードされています。このコマンドは、--output パラメータおよび --query パラメータを使用して出力を制御し、loaContent 構造の内容を抽出します。コマンドの最後の部分で base64 ユーティリティを使用してコンテンツをデコードし、出力を PDF ファイルに送信します。

aws directconnect describe-connection-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf

Windows を使用して接続用の LOA-CFA を記述するには

前の例では、base64 ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりに certutil を使用できます。次の例では、最初のコマンドで接続 dxcon-fh6ayh1d 用の LOA-CFA を記述し、--output パラメータと --query パラメータを使用して出力を制御し、loaContent 構造の内容を myLoaCfa.base64 というファイルに抽出します。2 番目のコマンドでは、certutil ユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。

aws directconnect describe-connection-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64
certutil -decode myLoaCfa.base64 myLoaCfa.pdf

AWS CLI 出力を制御する方法の詳細については、「AWS コマンドラインインターフェイスユーザーガイド」の「Controlling Command Output from the AWS Command Line Interface」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeConnectionLoa」を参照してください。

次の例は、describe-connection-loa を使用する方法を説明しています。

AWS CLI

Linux または Mac OS X を使用して接続用の LOA-CFA を記述するには

次の例では、接続 dxcon-fh6ayh1d 用の LOA-CFA を記述します。LOA-CFA の内容は base64 でエンコードされています。このコマンドは、--output パラメータおよび --query パラメータを使用して出力を制御し、loaContent 構造の内容を抽出します。コマンドの最後の部分で base64 ユーティリティを使用してコンテンツをデコードし、出力を PDF ファイルに送信します。

aws directconnect describe-connection-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf

Windows を使用して接続用の LOA-CFA を記述するには

前の例では、base64 ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりに certutil を使用できます。次の例では、最初のコマンドで接続 dxcon-fh6ayh1d 用の LOA-CFA を記述し、--output パラメータと --query パラメータを使用して出力を制御し、loaContent 構造の内容を myLoaCfa.base64 というファイルに抽出します。2 番目のコマンドでは、certutil ユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。

aws directconnect describe-connection-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64
certutil -decode myLoaCfa.base64 myLoaCfa.pdf

AWS CLI 出力を制御する方法の詳細については、「AWS コマンドラインインターフェイスユーザーガイド」の「Controlling Command Output from the AWS Command Line Interface」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeConnectionLoa」を参照してください。

次のコード例は、describe-connections-on-interconnect を使用する方法を示しています。

AWS CLI

相互接続上の接続を一覧表示するには

次の describe-connections-on-interconnect コマンドは、指定された相互接続上にプロビジョニングされた接続を一覧表示します。

aws directconnect describe-connections-on-interconnect --interconnect-id dxcon-fgktov66

出力:

{ "connections": [ { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" } ] }

次のコード例は、describe-connections-on-interconnect を使用する方法を示しています。

AWS CLI

相互接続上の接続を一覧表示するには

次の describe-connections-on-interconnect コマンドは、指定された相互接続上にプロビジョニングされた接続を一覧表示します。

aws directconnect describe-connections-on-interconnect --interconnect-id dxcon-fgktov66

出力:

{ "connections": [ { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" } ] }

次のコード例は、describe-connections を使用する方法を示しています。

AWS CLI

現在のリージョンのすべての接続を一覧表示するには

次の describe-connections コマンドは、現在のリージョン内にあるすべての接続を一覧表示します。

aws directconnect describe-connections

出力:

{ "connections": [ { "awsDevice": "EqDC2-123h49s71dabc", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "lagId": "dxlag-ffrz71kw", "connectionState": "down", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "My_Connection", "loaIssueTime": 1491568964.0, "region": "us-east-1" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeConnections」を参照してください。

次のコード例は、describe-connections を使用する方法を示しています。

AWS CLI

現在のリージョンのすべての接続を一覧表示するには

次の describe-connections コマンドは、現在のリージョン内にあるすべての接続を一覧表示します。

aws directconnect describe-connections

出力:

{ "connections": [ { "awsDevice": "EqDC2-123h49s71dabc", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "lagId": "dxlag-ffrz71kw", "connectionState": "down", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "My_Connection", "loaIssueTime": 1491568964.0, "region": "us-east-1" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeConnections」を参照してください。

次のコード例は、describe-direct-connect-gateway-association-proposals を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けの提案を記述するには

次の describe-direct-connect-gateway-association-proposals の例では、Direct Connect ゲートウェイの関連付けの提案に関する詳細を表示します。

aws directconnect describe-direct-connect-gateway-association-proposals

出力:

{ "directConnectGatewayAssociationProposals": [ { "proposalId": "c2ede9b4-bbc6-4d33-923c-bc4feEXAMPLE", "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "proposalState": "requested", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "existingAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.2.0/30" }, { "cidr": "192.168.1.0/30" } ], "requestedAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.1.0/30" } ] }, { "proposalId": "cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE", "directConnectGatewayId": "11560968-4ac1-4fd3-bcb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "proposalState": "accepted", "associatedGateway": { "id": "tgw-045776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "existingAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.4.0/30" }, { "cidr": "192.168.5.0/30" } ], "requestedAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.5.0/30" } ] } ] }

詳細については、「AWS Direct Connect ユーザーガイド」の「Associating and Disassociating Transit Gateways」を参照してください。

次のコード例は、describe-direct-connect-gateway-association-proposals を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けの提案を記述するには

次の describe-direct-connect-gateway-association-proposals の例では、Direct Connect ゲートウェイの関連付けの提案に関する詳細を表示します。

aws directconnect describe-direct-connect-gateway-association-proposals

出力:

{ "directConnectGatewayAssociationProposals": [ { "proposalId": "c2ede9b4-bbc6-4d33-923c-bc4feEXAMPLE", "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "proposalState": "requested", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "existingAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.2.0/30" }, { "cidr": "192.168.1.0/30" } ], "requestedAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.1.0/30" } ] }, { "proposalId": "cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE", "directConnectGatewayId": "11560968-4ac1-4fd3-bcb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "proposalState": "accepted", "associatedGateway": { "id": "tgw-045776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "existingAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.4.0/30" }, { "cidr": "192.168.5.0/30" } ], "requestedAllowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.5.0/30" } ] } ] }

詳細については、「AWS Direct Connect ユーザーガイド」の「Associating and Disassociating Transit Gateways」を参照してください。

次のコード例は、describe-direct-connect-gateway-associations を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けを記述するには

次の例では、Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample とのすべての関連付けについて説明します。

コマンド:

aws directconnect describe-direct-connect-gateway-associations --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample

出力:

{ "nextToken": "eyJ2IjoxLCJzIjoxLCJpIjoiOU83OTFodzdycnZCbkN4MExHeHVwQT09IiwiYyI6InIxTEN0UEVHV0I1UFlkaWFnNlUxanJkRWF6eW1iOElHM0FRVW1MdHRJK0dxcnN1RWtvcFBKWFE2ZjRNRGdGTkhCa0tDZmVINEtZOEYwZ0dEYWZpbmU0ZnZMYVhKRjdXRVdENmdQZ1Y4d2w0PSJ9", "directConnectGatewayAssociations": [ { "associationState": "associating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" }, { "associationState": "disassociating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-ebaa27db", "virtualGatewayRegion": "us-east-2" } ] }

次のコード例は、describe-direct-connect-gateway-associations を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けを記述するには

次の例では、Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample とのすべての関連付けについて説明します。

コマンド:

aws directconnect describe-direct-connect-gateway-associations --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample

出力:

{ "nextToken": "eyJ2IjoxLCJzIjoxLCJpIjoiOU83OTFodzdycnZCbkN4MExHeHVwQT09IiwiYyI6InIxTEN0UEVHV0I1UFlkaWFnNlUxanJkRWF6eW1iOElHM0FRVW1MdHRJK0dxcnN1RWtvcFBKWFE2ZjRNRGdGTkhCa0tDZmVINEtZOEYwZ0dEYWZpbmU0ZnZMYVhKRjdXRVdENmdQZ1Y4d2w0PSJ9", "directConnectGatewayAssociations": [ { "associationState": "associating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" }, { "associationState": "disassociating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-ebaa27db", "virtualGatewayRegion": "us-east-2" } ] }

次の例は、describe-direct-connect-gateway-attachments を使用する方法を説明しています。

AWS CLI

Direct Connect ゲートウェイのアタッチメントを記述するには

次の例では、Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample にアタッチされている仮想インターフェイスについて説明します。

コマンド:

aws directconnect describe-direct-connect-gateway-attachments --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample

出力:

{ "directConnectGatewayAttachments": [ { "virtualInterfaceOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualInterfaceRegion": "us-east-2", "attachmentState": "attaching", "virtualInterfaceId": "dxvif-fg9zyabc" } ], "nextToken": "eyJ2IjoxLCJzIjoxLCJpIjoibEhXdlNpUXF5RzhoL1JyUW52SlV2QT09IiwiYyI6Im5wQjFHQ0RyQUdRS3puNnNXcUlINCtkTTA4dTk3KzBiU0xtb05JQmlaczZ6NXRIYmk3c3VESUxFTTd6a2FzVHM0VTFwaGJkZGNxTytqWmQ3QzMzOGRQaTVrTThrOG1zelRsV3gyMWV3VTNFPSJ9" }

次の例は、describe-direct-connect-gateway-attachments を使用する方法を説明しています。

AWS CLI

Direct Connect ゲートウェイのアタッチメントを記述するには

次の例では、Direct Connect ゲートウェイ 5f294f92-bafb-4011-916d-9b0bexample にアタッチされている仮想インターフェイスについて説明します。

コマンド:

aws directconnect describe-direct-connect-gateway-attachments --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample

出力:

{ "directConnectGatewayAttachments": [ { "virtualInterfaceOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualInterfaceRegion": "us-east-2", "attachmentState": "attaching", "virtualInterfaceId": "dxvif-fg9zyabc" } ], "nextToken": "eyJ2IjoxLCJzIjoxLCJpIjoibEhXdlNpUXF5RzhoL1JyUW52SlV2QT09IiwiYyI6Im5wQjFHQ0RyQUdRS3puNnNXcUlINCtkTTA4dTk3KzBiU0xtb05JQmlaczZ6NXRIYmk3c3VESUxFTTd6a2FzVHM0VTFwaGJkZGNxTytqWmQ3QzMzOGRQaTVrTThrOG1zelRsV3gyMWV3VTNFPSJ9" }

次のコード例は、describe-direct-connect-gateways を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイを記述するには

次の例では、すべての Direct Connect ゲートウェイについて説明します。

コマンド:

aws directconnect describe-direct-connect-gateways

出力:

{ "directConnectGateways": [ { "amazonSideAsn": 64512, "directConnectGatewayId": "cf68415c-f4ae-48f2-87a7-3b52cexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway2", "directConnectGatewayState": "available" }, { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bdexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "available" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDirectConnectGateways」を参照してください。

次のコード例は、describe-direct-connect-gateways を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイを記述するには

次の例では、すべての Direct Connect ゲートウェイについて説明します。

コマンド:

aws directconnect describe-direct-connect-gateways

出力:

{ "directConnectGateways": [ { "amazonSideAsn": 64512, "directConnectGatewayId": "cf68415c-f4ae-48f2-87a7-3b52cexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway2", "directConnectGatewayState": "available" }, { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bdexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "available" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDirectConnectGateways」を参照してください。

次のコード例は、describe-hosted-connections を使用する方法を示しています。

AWS CLI

相互接続上の接続を一覧表示するには

次の例では、指定された相互接続上にプロビジョニングされている接続を一覧表示します。

コマンド:

aws directconnect describe-hosted-connections --connection-id dxcon-fgktov66

出力:

{ "connections": [ { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeHostedConnections」を参照してください。

次のコード例は、describe-hosted-connections を使用する方法を示しています。

AWS CLI

相互接続上の接続を一覧表示するには

次の例では、指定された相互接続上にプロビジョニングされている接続を一覧表示します。

コマンド:

aws directconnect describe-hosted-connections --connection-id dxcon-fgktov66

出力:

{ "connections": [ { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeHostedConnections」を参照してください。

次の例は、describe-interconnect-loa を使用する方法を説明しています。

AWS CLI

Linux または Mac OS X を使用して相互接続用の LOA-CFA を記述するには

次の例では、相互接続 dxcon-fh6ayh1d 用の LOA-CFA を記述します。LOA-CFA の内容は base64 でエンコードされています。このコマンドは、--output パラメータおよび --query パラメータを使用して出力を制御し、loaContent 構造の内容を抽出します。コマンドの最後の部分で base64 ユーティリティを使用してコンテンツをデコードし、出力を PDF ファイルに送信します。

aws directconnect describe-interconnect-loa --interconnect-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf

Windows を使用して相互接続用の LOA-CFA を記述するには

前の例では、base64 ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりに certutil を使用できます。次の例では、最初のコマンドで相互接続 dxcon-fh6ayh1d 用の LOA-CFA を記述し、--output パラメータと --query パラメータを使用して出力を制御し、loaContent 構造の内容を myLoaCfa.base64 というファイルに抽出します。2 番目のコマンドでは、certutil ユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。

aws directconnect describe-interconnect-loa --interconnect-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64
certutil -decode myLoaCfa.base64 myLoaCfa.pdf

AWS CLI 出力を制御する方法の詳細については、「AWS コマンドラインインターフェイスユーザーガイド」の「Controlling Command Output from the AWS Command Line Interface」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeInterconnectLoa」を参照してください。

次の例は、describe-interconnect-loa を使用する方法を説明しています。

AWS CLI

Linux または Mac OS X を使用して相互接続用の LOA-CFA を記述するには

次の例では、相互接続 dxcon-fh6ayh1d 用の LOA-CFA を記述します。LOA-CFA の内容は base64 でエンコードされています。このコマンドは、--output パラメータおよび --query パラメータを使用して出力を制御し、loaContent 構造の内容を抽出します。コマンドの最後の部分で base64 ユーティリティを使用してコンテンツをデコードし、出力を PDF ファイルに送信します。

aws directconnect describe-interconnect-loa --interconnect-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf

Windows を使用して相互接続用の LOA-CFA を記述するには

前の例では、base64 ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりに certutil を使用できます。次の例では、最初のコマンドで相互接続 dxcon-fh6ayh1d 用の LOA-CFA を記述し、--output パラメータと --query パラメータを使用して出力を制御し、loaContent 構造の内容を myLoaCfa.base64 というファイルに抽出します。2 番目のコマンドでは、certutil ユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。

aws directconnect describe-interconnect-loa --interconnect-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64
certutil -decode myLoaCfa.base64 myLoaCfa.pdf

AWS CLI 出力を制御する方法の詳細については、「AWS コマンドラインインターフェイスユーザーガイド」の「Controlling Command Output from the AWS Command Line Interface」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeInterconnectLoa」を参照してください。

次のコード例は、describe-interconnects を使用する方法を示しています。

AWS CLI

相互接続を一覧表示するには

次の describe-interconnects コマンドは、AWS アカウントが所有する相互接続を一覧表示します。

aws directconnect describe-interconnects

出力:

{ "interconnects": [ { "region": "sa-east-1", "bandwidth": "1Gbps", "location": "TIVIT", "interconnectName": "1G Interconnect to AWS", "interconnectId": "dxcon-fgktov66", "interconnectState": "down" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeInterconnects」を参照してください。

次のコード例は、describe-interconnects を使用する方法を示しています。

AWS CLI

相互接続を一覧表示するには

次の describe-interconnects コマンドは、AWS アカウントが所有する相互接続を一覧表示します。

aws directconnect describe-interconnects

出力:

{ "interconnects": [ { "region": "sa-east-1", "bandwidth": "1Gbps", "location": "TIVIT", "interconnectName": "1G Interconnect to AWS", "interconnectId": "dxcon-fgktov66", "interconnectState": "down" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeInterconnects」を参照してください。

次のコード例は、describe-lags を使用する方法を示しています。

AWS CLI

LAG を記述するには

次のコマンドは、現在のリージョンのすべての LAG について表示します。

コマンド:

aws directconnect describe-lags

出力:

{ "lags": [ { "awsDevice": "EqDC2-19y7z3m17xpuz", "numberOfConnections": 2, "lagState": "down", "ownerAccount": "123456789012", "lagName": "DA-LAG", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-ffnikghc", "lagId": "dxlag-fgsu9erb", "connectionState": "requested", "bandwidth": "10Gbps", "location": "EqDC2", "connectionName": "Requested Connection 1 for Lag dxlag-fgsu9erb", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fglgbdea", "lagId": "dxlag-fgsu9erb", "connectionState": "requested", "bandwidth": "10Gbps", "location": "EqDC2", "connectionName": "Requested Connection 2 for Lag dxlag-fgsu9erb", "region": "us-east-1" } ], "lagId": "dxlag-fgsu9erb", "minimumLinks": 0, "connectionsBandwidth": "10Gbps", "region": "us-east-1", "location": "EqDC2" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeLags」を参照してください。

次のコード例は、describe-lags を使用する方法を示しています。

AWS CLI

LAG を記述するには

次のコマンドは、現在のリージョンのすべての LAG について表示します。

コマンド:

aws directconnect describe-lags

出力:

{ "lags": [ { "awsDevice": "EqDC2-19y7z3m17xpuz", "numberOfConnections": 2, "lagState": "down", "ownerAccount": "123456789012", "lagName": "DA-LAG", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-ffnikghc", "lagId": "dxlag-fgsu9erb", "connectionState": "requested", "bandwidth": "10Gbps", "location": "EqDC2", "connectionName": "Requested Connection 1 for Lag dxlag-fgsu9erb", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fglgbdea", "lagId": "dxlag-fgsu9erb", "connectionState": "requested", "bandwidth": "10Gbps", "location": "EqDC2", "connectionName": "Requested Connection 2 for Lag dxlag-fgsu9erb", "region": "us-east-1" } ], "lagId": "dxlag-fgsu9erb", "minimumLinks": 0, "connectionsBandwidth": "10Gbps", "region": "us-east-1", "location": "EqDC2" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeLags」を参照してください。

次のコード例は、describe-loa を使用する方法を示しています。

AWS CLI

Linux または Mac OS X を使用して接続用の LOA-CFA を記述するには

次の例では、接続 dxcon-fh6ayh1d 用の LOA-CFA を記述します。LOA-CFA の内容は base64 でエンコードされています。このコマンドは、--output パラメータおよび --query パラメータを使用して出力を制御し、loaContent 構造の内容を抽出します。コマンドの最後の部分で base64 ユーティリティを使用してコンテンツをデコードし、出力を PDF ファイルに送信します。

aws directconnect describe-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf

Windows を使用して接続用の LOA-CFA を記述するには

前の例では、base64 ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりに certutil を使用できます。次の例では、最初のコマンドで接続 dxcon-fh6ayh1d 用の LOA-CFA を記述し、--output パラメータと --query パラメータを使用して出力を制御し、loaContent 構造の内容を myLoaCfa.base64 というファイルに抽出します。2 番目のコマンドでは、certutil ユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。

aws directconnect describe-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64
certutil -decode myLoaCfa.base64 myLoaCfa.pdf

AWS CLI 出力を制御する方法の詳細については、「AWS コマンドラインインターフェイスユーザーガイド」の「Controlling Command Output from the AWS Command Line Interface」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeLoa」を参照してください。

次のコード例は、describe-loa を使用する方法を示しています。

AWS CLI

Linux または Mac OS X を使用して接続用の LOA-CFA を記述するには

次の例では、接続 dxcon-fh6ayh1d 用の LOA-CFA を記述します。LOA-CFA の内容は base64 でエンコードされています。このコマンドは、--output パラメータおよび --query パラメータを使用して出力を制御し、loaContent 構造の内容を抽出します。コマンドの最後の部分で base64 ユーティリティを使用してコンテンツをデコードし、出力を PDF ファイルに送信します。

aws directconnect describe-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf

Windows を使用して接続用の LOA-CFA を記述するには

前の例では、base64 ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりに certutil を使用できます。次の例では、最初のコマンドで接続 dxcon-fh6ayh1d 用の LOA-CFA を記述し、--output パラメータと --query パラメータを使用して出力を制御し、loaContent 構造の内容を myLoaCfa.base64 というファイルに抽出します。2 番目のコマンドでは、certutil ユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。

aws directconnect describe-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64
certutil -decode myLoaCfa.base64 myLoaCfa.pdf

AWS CLI 出力を制御する方法の詳細については、「AWS コマンドラインインターフェイスユーザーガイド」の「Controlling Command Output from the AWS Command Line Interface」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeLoa」を参照してください。

次の例は、describe-locations を使用する方法を説明しています。

AWS CLI

AWS Direct Connect のパートナーとロケーションを一覧表示するには

次の describe-locations コマンドは、現在のリージョン内にある AWS Direct Connect パートナーとロケーションを一覧表示します。

aws directconnect describe-locations

出力:

{ "locations": [ { "locationName": "NAP do Brasil, Barueri, Sao Paulo", "locationCode": "TNDB" }, { "locationName": "Tivit - Site Transamerica (Sao Paulo)", "locationCode": "TIVIT" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeLocations」を参照してください。

次の例は、describe-locations を使用する方法を説明しています。

AWS CLI

AWS Direct Connect のパートナーとロケーションを一覧表示するには

次の describe-locations コマンドは、現在のリージョン内にある AWS Direct Connect パートナーとロケーションを一覧表示します。

aws directconnect describe-locations

出力:

{ "locations": [ { "locationName": "NAP do Brasil, Barueri, Sao Paulo", "locationCode": "TNDB" }, { "locationName": "Tivit - Site Transamerica (Sao Paulo)", "locationCode": "TIVIT" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeLocations」を参照してください。

次のコード例は、describe-tags を使用する方法を示しています。

AWS CLI

AWS Direct Connect リソースのタグを記述するには

次のコマンドは、接続 dxcon-abcabc12 のタグについて表示します。

コマンド:

aws directconnect describe-tags --resource-arns arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12

出力:

{ "resourceTags": [ { "resourceArn": "arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12", "tags": [ { "value": "VAConnection", "key": "Name" } ] } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeTags」を参照してください。

次のコード例は、describe-tags を使用する方法を示しています。

AWS CLI

AWS Direct Connect リソースのタグを記述するには

次のコマンドは、接続 dxcon-abcabc12 のタグについて表示します。

コマンド:

aws directconnect describe-tags --resource-arns arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12

出力:

{ "resourceTags": [ { "resourceArn": "arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12", "tags": [ { "value": "VAConnection", "key": "Name" } ] } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeTags」を参照してください。

次のコード例は、describe-virtual-gateways を使用する方法を示しています。

AWS CLI

仮想プライベートゲートウェイを一覧表示するには

次の describe-virtual-gateways コマンドは、AWS アカウントが所有する仮想プライベートゲートウェイを一覧表示します。

aws directconnect describe-virtual-gateways

出力:

{ "virtualGateways": [ { "virtualGatewayId": "vgw-aba37db6", "virtualGatewayState": "available" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeVirtualGateways」を参照してください。

次のコード例は、describe-virtual-gateways を使用する方法を示しています。

AWS CLI

仮想プライベートゲートウェイを一覧表示するには

次の describe-virtual-gateways コマンドは、AWS アカウントが所有する仮想プライベートゲートウェイを一覧表示します。

aws directconnect describe-virtual-gateways

出力:

{ "virtualGateways": [ { "virtualGatewayId": "vgw-aba37db6", "virtualGatewayState": "available" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeVirtualGateways」を参照してください。

次の例は、describe-virtual-interfaces を使用する方法を説明しています。

AWS CLI

すべての仮想インターフェイスを一覧表示するには

次の describe-virtual-interfaces コマンドは、AWS アカウントに関連付けられているすべての仮想インターフェイスに関する情報を一覧表示します。

aws directconnect describe-virtual-interfaces --connection-id dxcon-ffjrkx17

出力:

{ "virtualInterfaces": [ { "virtualInterfaceState": "down", "asn": 65000, "vlan": 101, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "vgw-aba37db6", "virtualInterfaceId": "dxvif-ffhhk74f", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-ffhhk74f\">\n <vlan>101</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }, { "virtualInterfaceState": "verifying", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "", "virtualInterfaceId": "dxvif-fgh0hcrk", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.4/30" }, { "cidr": "203.0.113.0/30" } ], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fgh0hcrk\">\n <vlan>2000</vlan>\n <customer_address>203.0.113.2/30</customer_address>\n <amazon_address>203.0.113.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>public</connection_type>\n</logical_connection>\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeVirtualInterfaces」を参照してください。

次の例は、describe-virtual-interfaces を使用する方法を説明しています。

AWS CLI

すべての仮想インターフェイスを一覧表示するには

次の describe-virtual-interfaces コマンドは、AWS アカウントに関連付けられているすべての仮想インターフェイスに関する情報を一覧表示します。

aws directconnect describe-virtual-interfaces --connection-id dxcon-ffjrkx17

出力:

{ "virtualInterfaces": [ { "virtualInterfaceState": "down", "asn": 65000, "vlan": 101, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "vgw-aba37db6", "virtualInterfaceId": "dxvif-ffhhk74f", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-ffhhk74f\">\n <vlan>101</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>private</connection_type>\n</logical_connection>\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }, { "virtualInterfaceState": "verifying", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "", "virtualInterfaceId": "dxvif-fgh0hcrk", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.4/30" }, { "cidr": "203.0.113.0/30" } ], "location": "TIVIT", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fgh0hcrk\">\n <vlan>2000</vlan>\n <customer_address>203.0.113.2/30</customer_address>\n <amazon_address>203.0.113.1/30</amazon_address>\n <bgp_asn>65000</bgp_asn>\n <bgp_auth_key>asdf34example</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>public</connection_type>\n</logical_connection>\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" } ] }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeVirtualInterfaces」を参照してください。

次の例は、disassociate-connection-from-lag を使用する方法を説明しています。

AWS CLI

LAG から接続の関連付けを解除するには

次の例では、指定された接続の関連付けを指定された LAG から解除します。

コマンド:

aws directconnect disassociate-connection-from-lag --lag-id dxlag-fhccu14t --connection-id dxcon-fg9607vm

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Con2ForLag", "region": "us-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DisassociateConnectionFromLag」を参照してください。

次の例は、disassociate-connection-from-lag を使用する方法を説明しています。

AWS CLI

LAG から接続の関連付けを解除するには

次の例では、指定された接続の関連付けを指定された LAG から解除します。

コマンド:

aws directconnect disassociate-connection-from-lag --lag-id dxlag-fhccu14t --connection-id dxcon-fg9607vm

出力:

{ "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Con2ForLag", "region": "us-east-1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DisassociateConnectionFromLag」を参照してください。

次のコード例は、tag-resource を使用する方法を示しています。

AWS CLI

AWS Direct Connect リソースにタグを追加するには

次のコマンドは、キー Name と値 VAConnection を持つタグを接続 dxcon-abcabc12 に追加します。コマンドが成功した場合、出力は返りません。

コマンド:

aws directconnect tag-resource --resource-arn arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12 --tags "key=Name,value=VAConnection"
  • API の詳細については、「AWS CLI コマンドリファレンス」の「TagResource」を参照してください。

次のコード例は、tag-resource を使用する方法を示しています。

AWS CLI

AWS Direct Connect リソースにタグを追加するには

次のコマンドは、キー Name と値 VAConnection を持つタグを接続 dxcon-abcabc12 に追加します。コマンドが成功した場合、出力は返りません。

コマンド:

aws directconnect tag-resource --resource-arn arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12 --tags "key=Name,value=VAConnection"
  • API の詳細については、「AWS CLI コマンドリファレンス」の「TagResource」を参照してください。

次のコード例は、untag-resource を使用する方法を示しています。

AWS CLI

AWS Direct Connect リソースからタグを削除するには

次のコマンドは、キー Name を持つタグを接続 dxcon-abcabc12 から削除します。コマンドが成功した場合、出力は返りません。

コマンド:

aws directconnect untag-resource --resource-arn arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12 --tag-keys Name
  • API の詳細については、「AWS CLI コマンドリファレンス」の「UntagResource」を参照してください。

次のコード例は、untag-resource を使用する方法を示しています。

AWS CLI

AWS Direct Connect リソースからタグを削除するには

次のコマンドは、キー Name を持つタグを接続 dxcon-abcabc12 から削除します。コマンドが成功した場合、出力は返りません。

コマンド:

aws directconnect untag-resource --resource-arn arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12 --tag-keys Name
  • API の詳細については、「AWS CLI コマンドリファレンス」の「UntagResource」を参照してください。

次のコード例は、update-direct-connect-gateway-association を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けの指定された属性を更新するには

次の update-direct-connect-gateway-association の例では、指定された CIDR ブロックを Direct Connect ゲートウェイの関連付けに追加します。

aws directconnect update-direct-connect-gateway-association \ --association-id 820a6e4f-5374-4004-8317-3f64bEXAMPLE \ --add-allowed-prefixes-to-direct-connect-gateway cidr=192.168.2.0/30

出力:

{ "directConnectGatewayAssociation": { "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "associationState": "updating", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "associationId": "820a6e4f-5374-4004-8317-3f64bEXAMPLE", "allowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.2.0/30" }, { "cidr": "192.168.1.0/30" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Working with Direct Connect Gateways」を参照してください。

次のコード例は、update-direct-connect-gateway-association を使用する方法を示しています。

AWS CLI

Direct Connect ゲートウェイの関連付けの指定された属性を更新するには

次の update-direct-connect-gateway-association の例では、指定された CIDR ブロックを Direct Connect ゲートウェイの関連付けに追加します。

aws directconnect update-direct-connect-gateway-association \ --association-id 820a6e4f-5374-4004-8317-3f64bEXAMPLE \ --add-allowed-prefixes-to-direct-connect-gateway cidr=192.168.2.0/30

出力:

{ "directConnectGatewayAssociation": { "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", "directConnectGatewayOwnerAccount": "111122223333", "associationState": "updating", "associatedGateway": { "id": "tgw-02f776b1a7EXAMPLE", "type": "transitGateway", "ownerAccount": "111122223333", "region": "us-east-1" }, "associationId": "820a6e4f-5374-4004-8317-3f64bEXAMPLE", "allowedPrefixesToDirectConnectGateway": [ { "cidr": "192.168.2.0/30" }, { "cidr": "192.168.1.0/30" } ] } }

詳細については、「AWS Direct Connect ユーザーガイド」の「Working with Direct Connect Gateways」を参照してください。

次のコード例は、update-lag を使用する方法を示しています。

AWS CLI

LAG を更新するには

次の例では、指定された LAG の名前を変更します。

コマンド:

aws directconnect update-lag --lag-id dxlag-ffjhj9lx --lag-name 2ConnLag

出力:

{ "awsDevice": "CSVA1-23u8tlpaz8iks", "numberOfConnections": 2, "lagState": "down", "ownerAccount": "123456789012", "lagName": "2ConnLag", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-fflqyj95", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 2 for Lag dxlag-ffjhj9lx", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-ffqr6x5q", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 1 for Lag dxlag-ffjhj9lx", "region": "us-east-1" } ], "lagId": "dxlag-ffjhj9lx", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "CSVA1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「UpdateLag」を参照してください。

次のコード例は、update-lag を使用する方法を示しています。

AWS CLI

LAG を更新するには

次の例では、指定された LAG の名前を変更します。

コマンド:

aws directconnect update-lag --lag-id dxlag-ffjhj9lx --lag-name 2ConnLag

出力:

{ "awsDevice": "CSVA1-23u8tlpaz8iks", "numberOfConnections": 2, "lagState": "down", "ownerAccount": "123456789012", "lagName": "2ConnLag", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-fflqyj95", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 2 for Lag dxlag-ffjhj9lx", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-ffqr6x5q", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 1 for Lag dxlag-ffjhj9lx", "region": "us-east-1" } ], "lagId": "dxlag-ffjhj9lx", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "CSVA1" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「UpdateLag」を参照してください。

次のコード例は、update-virtual-interface-attributes を使用する方法を示しています。

AWS CLI

仮想インターフェイスの MTU を更新するには

次の update-virtual-interface-attributes の例では、指定された仮想インターフェイスの MTU を更新しています。

aws directconnect update-virtual-interface-attributes \ --virtual-interface-id dxvif-fEXAMPLE \ --mtu 1500

出力:

{ "ownerAccount": "1111222233333", "virtualInterfaceId": "dxvif-fEXAMPLE", "location": "loc1", "connectionId": "dxlag-fEXAMPLE", "virtualInterfaceType": "transit", "virtualInterfaceName": "example transit virtual interface", "vlan": 125, "asn": 650001, "amazonSideAsn": 64512, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "amazonAddress": "169.254.248.1/30", "customerAddress": "169.254.248.2/30", "addressFamily": "ipv4", "virtualInterfaceState": "down", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>125</vlan>\n <customer_address>169.254.248.2/30</customer_address>\n <amazon_address>169.254.248.1/30</amazon_address>\n <bgp_asn>650001</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SEXAMPLE</bgp_auth_key>\n <amazon_bgp_asn>64512</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", "mtu": 1500, "jumboFrameCapable": true, "virtualGatewayId": "", "directConnectGatewayId": "879b76a1-403d-4700-8b53-4a56ed85436e", "routeFilterPrefixes": [], "bgpPeers": [ { "bgpPeerId": "dxpeer-fEXAMPLE", "asn": 650001, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "addressFamily": "ipv4", "amazonAddress": "169.254.248.1/30", "customerAddress": "169.254.248.2/30", "bgpPeerState": "available", "bgpStatus": "down", "awsDeviceV2": "loc1-26wz6vEXAMPLE" } ], "region": "sa-east-1", "awsDeviceV2": "loc1-26wz6vEXAMPLE", "tags": [] }

詳細については、「AWS Direct Connect ユーザーガイド」の「Setting Network MTU for Private Virtual Interfaces or Transit Virtual Interfaces」を参照してください。

次のコード例は、update-virtual-interface-attributes を使用する方法を示しています。

AWS CLI

仮想インターフェイスの MTU を更新するには

次の update-virtual-interface-attributes の例では、指定された仮想インターフェイスの MTU を更新しています。

aws directconnect update-virtual-interface-attributes \ --virtual-interface-id dxvif-fEXAMPLE \ --mtu 1500

出力:

{ "ownerAccount": "1111222233333", "virtualInterfaceId": "dxvif-fEXAMPLE", "location": "loc1", "connectionId": "dxlag-fEXAMPLE", "virtualInterfaceType": "transit", "virtualInterfaceName": "example transit virtual interface", "vlan": 125, "asn": 650001, "amazonSideAsn": 64512, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "amazonAddress": "169.254.248.1/30", "customerAddress": "169.254.248.2/30", "addressFamily": "ipv4", "virtualInterfaceState": "down", "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>125</vlan>\n <customer_address>169.254.248.2/30</customer_address>\n <amazon_address>169.254.248.1/30</amazon_address>\n <bgp_asn>650001</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SEXAMPLE</bgp_auth_key>\n <amazon_bgp_asn>64512</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", "mtu": 1500, "jumboFrameCapable": true, "virtualGatewayId": "", "directConnectGatewayId": "879b76a1-403d-4700-8b53-4a56ed85436e", "routeFilterPrefixes": [], "bgpPeers": [ { "bgpPeerId": "dxpeer-fEXAMPLE", "asn": 650001, "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", "addressFamily": "ipv4", "amazonAddress": "169.254.248.1/30", "customerAddress": "169.254.248.2/30", "bgpPeerState": "available", "bgpStatus": "down", "awsDeviceV2": "loc1-26wz6vEXAMPLE" } ], "region": "sa-east-1", "awsDeviceV2": "loc1-26wz6vEXAMPLE", "tags": [] }

詳細については、「AWS Direct Connect ユーザーガイド」の「Setting Network MTU for Private Virtual Interfaces or Transit Virtual Interfaces」を参照してください。

このページの内容

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.