Direct Connect examples using AWS CLI
次のコード例では、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-id11460968-4ac1-4fd3-bdb2-00599EXAMPLE\ --proposal-idcb7f41cb-8128-43a5-93b1-dcaedEXAMPLE\ --associated-gateway-owner-account111122223333{"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」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「AcceptDirectConnectGatewayAssociationProposal
」を参照してください。
-
次の例は、allocate-connection-on-interconnect を使用する方法を説明しています。
- AWS CLI
-
相互接続上にホスト接続を作成するには
次の
allocate-connection-on-interconnectコマンドは、相互接続上にホスト接続を作成します。aws directconnect allocate-connection-on-interconnect --bandwidth500Mbps--connection-namemydcinterconnect--owner-account123456789012--interconnect-iddxcon-fgktov66--vlan101出力:
{ "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }-
API の詳細については、「AWS CLI コマンドリファレンス」の「AllocateConnectionOnInterconnect
」を参照してください。
-
次の例は、allocate-hosted-connection を使用する方法を説明しています。
- AWS CLI
-
相互接続上にホスト接続を作成するには
次の
allocate-hosted-connectionの例では、指定された相互接続上にホスト接続を作成します。aws directconnect allocate-hosted-connection \ --bandwidth500Mbps\ --connection-namemydcinterconnect\ --owner-account123456789012-connection-iddxcon-fgktov66-vlan101出力:
{ "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-iddxcon-ffjrkx17--owner-account123456789012--new-private-virtual-interface-allocationvirtualInterfaceName=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" }-
API の詳細については、「AWS CLI コマンドリファレンス」の「AllocatePrivateVirtualInterface
」を参照してください。
-
次の例は、allocate-public-virtual-interface を使用する方法を説明しています。
- AWS CLI
-
パブリック仮想インターフェイスをプロビジョニングするには
次の
allocate-public-virtual-interfaceコマンドは、別の顧客が所有できるようにパブリック仮想インターフェイスをプロビジョニングします。aws directconnect allocate-public-virtual-interface --connection-iddxcon-ffjrkx17--owner-account123456789012--new-public-virtual-interface-allocationvirtualInterfaceName=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" }-
API の詳細については、「AWS CLI コマンドリファレンス」の「AllocatePublicVirtualInterface
」を参照してください。
-
次の例は、allocate-transit-virtual-interface を使用する方法を説明しています。
- AWS CLI
-
指定された AWS アカウントが所有できるようにトランジット仮想インターフェイスをプロビジョニングするには
次の
allocate-transit-virtual-interfaceの例では、指定されたアカウントのトランジット仮想インターフェイスをプロビジョニングします。aws directconnect allocate-transit-virtual-interface \ --connection-iddxlag-fEXAMPLE\ --owner-account123456789012\ --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」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「AllocateTransitVirtualInterface
」を参照してください。
-
次の例は、associate-connection-with-lag を使用する方法を説明しています。
- AWS CLI
-
接続を LAG と関連付けるには
次の例では、指定した接続を指定した LAG と関連付けます。
コマンド:
aws directconnect associate-connection-with-lag --lag-iddxlag-fhccu14t--connection-iddxcon-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-iddxlag-fhccu14t--connection-iddxcon-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-iddxlag-ffjhj9lx--virtual-interface-iddxvif-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-iddxcon-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-iddxvif-fgy8orxu--virtual-gateway-idvgw-e4a47df9出力:
{ "virtualInterfaceState": "pending" }-
API の詳細については、「AWS CLI コマンドリファレンス」の「ConfirmPrivateVirtualInterface
」を参照してください。
-
次の例は、confirm-public-virtual-interface を使用する方法を説明しています。
- AWS CLI
-
パブリック仮想インターフェイスの所有権を承諾するには
次の
confirm-public-virtual-interfaceコマンドは、別の顧客が作成したパブリック仮想インターフェイスの所有権を承諾します。aws directconnect confirm-public-virtual-interface --virtual-interface-iddxvif-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-iddxvif-fEXAMPLE\ --direct-connect-gateway-id4112ccf9-25e9-4111-8237-b6c5dEXAMPLE出力:
{ "virtualInterfaceState": "pending" }詳細については、「AWS Direct Connect ユーザーガイド」の「Accepting a Hosted Virtual Interface」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ConfirmTransitVirtualInterface
」を参照してください。
-
次の例は、create-bgp-peer を使用する方法を説明しています。
- AWS CLI
-
IPv6 BGP ピアリングセッションを作成するには
次の例では、プライベート仮想インターフェイス
dxvif-fg1vuj3dに IPv6 BGP ピアリングセッションを作成します。ピア IPv6 アドレスは Amazon によって自動的に割り当てられます。コマンド:
aws directconnect create-bgp-peer --virtual-interface-iddxvif-fg1vuj3d--new-bgp-peerasn=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 --locationTIVIT--bandwidth1Gbps--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-id11460968-4ac1-4fd3-bdb2-00599EXAMPLE\ --direct-connect-gateway-owner-account111122223333\ --gateway-idtgw-02f776b1a7EXAMPLE\ --add-allowed-prefixes-to-direct-connect-gatewaycidr=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」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDirectConnectGatewayAssociationProposal
」を参照してください。
-
次の例は、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-id5f294f92-bafb-4011-916d-9b0bexample--virtual-gateway-idvgw-6efe725e出力:
{ "directConnectGatewayAssociation": { "associationState": "associating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDirectConnectGatewayAssociation
」を参照してください。
-
次の例は、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"--bandwidth1Gbps--locationTIVIT出力:
{ "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 --locationCSVA1--number-of-connections2--connections-bandwidth1Gbps--lag-name1GBLag出力:
{ "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 --locationEqDC2--number-of-connections2--connections-bandwidth1Gbps--lag-name2ConnLAG--connection-iddxcon-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-iddxcon-ffjrkx17--new-private-virtual-interfacevirtualInterfaceName=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-iddxcon-ffjrkx17--new-public-virtual-interfacevirtualInterfaceName=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-iddxlag-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-iddxvif-fg1vuj3d--asn64600--customer-address2001: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-iddxcon-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-idbe85116d-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」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDirectConnectGatewayAssociation
」を参照してください。
-
次の例は、delete-direct-connect-gateway を使用する方法を説明しています。
- AWS CLI
-
Direct Connect ゲートウェイを削除するには
次の例では、Direct Connect ゲートウェイ
5f294f92-bafb-4011-916d-9b0bexampleを削除します。コマンド:
aws directconnect delete-direct-connect-gateway --direct-connect-gateway-id5f294f92-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-iddxcon-fgktov66出力:
{ "interconnectState": "deleted" }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteInterconnect
」を参照してください。
-
次の例は、delete-lag を使用する方法を説明しています。
- AWS CLI
-
LAG を削除するには
次の例では、指定した LAG を削除します。
コマンド:
aws directconnect delete-lag --lag-iddxlag-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-iddxvif-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-iddxcon-fh6ayh1d--outputtext--queryloa.loaContent|base64--decode>myLoaCfa.pdfWindows を使用して接続用の LOA-CFA を記述するには
前の例では、
base64ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりにcertutilを使用できます。次の例では、最初のコマンドで接続dxcon-fh6ayh1d用の LOA-CFA を記述し、--outputパラメータと--queryパラメータを使用して出力を制御し、loaContent構造の内容をmyLoaCfa.base64というファイルに抽出します。2 番目のコマンドでは、certutilユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。aws directconnect describe-connection-loa --connection-iddxcon-fh6ayh1d--outputtext--queryloa.loaContent>myLoaCfa.base64certutil -decode myLoaCfa.base64 myLoaCfa.pdfAWS 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-iddxcon-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 コマンドリファレンス」の「DescribeConnectionsOnInterconnect
」を参照してください。
-
次の例は、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」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDirectConnectGatewayAssociationProposals
」を参照してください。
-
次の例は、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-id5f294f92-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" } ] }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDirectConnectGatewayAssociations
」を参照してください。
-
次の例は、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-id5f294f92-bafb-4011-916d-9b0bexample出力:
{ "directConnectGatewayAttachments": [ { "virtualInterfaceOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualInterfaceRegion": "us-east-2", "attachmentState": "attaching", "virtualInterfaceId": "dxvif-fg9zyabc" } ], "nextToken": "eyJ2IjoxLCJzIjoxLCJpIjoibEhXdlNpUXF5RzhoL1JyUW52SlV2QT09IiwiYyI6Im5wQjFHQ0RyQUdRS3puNnNXcUlINCtkTTA4dTk3KzBiU0xtb05JQmlaczZ6NXRIYmk3c3VESUxFTTd6a2FzVHM0VTFwaGJkZGNxTytqWmQ3QzMzOGRQaTVrTThrOG1zelRsV3gyMWV3VTNFPSJ9" }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDirectConnectGatewayAttachments
」を参照してください。
-
次の例は、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-iddxcon-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-iddxcon-fh6ayh1d--outputtext--queryloa.loaContent|base64--decode>myLoaCfa.pdfWindows を使用して相互接続用の LOA-CFA を記述するには
前の例では、
base64ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりにcertutilを使用できます。次の例では、最初のコマンドで相互接続dxcon-fh6ayh1d用の LOA-CFA を記述し、--outputパラメータと--queryパラメータを使用して出力を制御し、loaContent構造の内容をmyLoaCfa.base64というファイルに抽出します。2 番目のコマンドでは、certutilユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。aws directconnect describe-interconnect-loa --interconnect-iddxcon-fh6ayh1d--outputtext--queryloa.loaContent>myLoaCfa.base64certutil -decode myLoaCfa.base64 myLoaCfa.pdfAWS 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-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-iddxcon-fh6ayh1d--outputtext--queryloa.loaContent|base64--decode>myLoaCfa.pdfWindows を使用して接続用の LOA-CFA を記述するには
前の例では、
base64ユーティリティを使用して出力をデコードする必要がありました。Windows コンピュータでは、代わりにcertutilを使用できます。次の例では、最初のコマンドで接続dxcon-fh6ayh1d用の LOA-CFA を記述し、--outputパラメータと--queryパラメータを使用して出力を制御し、loaContent構造の内容をmyLoaCfa.base64というファイルに抽出します。2 番目のコマンドでは、certutilユーティリティを使用してファイルをデコードし、PDF ファイルに出力を送信します。aws directconnect describe-loa --connection-iddxcon-fh6ayh1d--outputtext--queryloa.loaContent>myLoaCfa.base64certutil -decode myLoaCfa.base64 myLoaCfa.pdfAWS 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-tags を使用する方法を説明しています。
- AWS CLI
-
AWS Direct Connect リソースのタグを記述するには
次のコマンドは、接続
dxcon-abcabc12のタグについて表示します。コマンド:
aws directconnect describe-tags --resource-arnsarn: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-interfaces を使用する方法を説明しています。
- AWS CLI
-
すべての仮想インターフェイスを一覧表示するには
次の
describe-virtual-interfacesコマンドは、AWS アカウントに関連付けられているすべての仮想インターフェイスに関する情報を一覧表示します。aws directconnect describe-virtual-interfaces --connection-iddxcon-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-iddxlag-fhccu14t--connection-iddxcon-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-arnarn: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-arnarn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12--tag-keysName-
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-id820a6e4f-5374-4004-8317-3f64bEXAMPLE\ --add-allowed-prefixes-to-direct-connect-gatewaycidr=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」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「UpdateDirectConnectGatewayAssociation
」を参照してください。
-
次の例は、update-lag を使用する方法を説明しています。
- AWS CLI
-
LAG を更新するには
次の例では、指定された LAG の名前を変更します。
コマンド:
aws directconnect update-lag --lag-iddxlag-ffjhj9lx--lag-name2ConnLag出力:
{ "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-iddxvif-fEXAMPLE\ --mtu1500出力:
{ "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」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「UpdateVirtualInterfaceAttributes
」を参照してください。
-