AWS 文档 SDK 示例
将 CreateCustomerGateway 与 CLI 配合使用
以下代码示例演示如何使用 CreateCustomerGateway。
- CLI
-
- AWS CLI
-
创建客户网关
此示例为其外部接口创建一个具有指定 IP 地址的客户网关。
命令:
aws ec2 create-customer-gateway --typeipsec.1--public-ip12.1.2.3--bgp-asn65534输出:
{ "CustomerGateway": { "CustomerGatewayId": "cgw-0e11f167", "IpAddress": "12.1.2.3", "State": "available", "Type": "ipsec.1", "BgpAsn": "65534" } }-
有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 CreateCustomerGateway
。
-
- PowerShell
-
- Tools for PowerShell V4
-
示例 1:此示例创建指定的客户网关。
New-EC2CustomerGateway -Type ipsec.1 -PublicIp 203.0.113.12 -BgpAsn 65534输出:
BgpAsn : 65534 CustomerGatewayId : cgw-1a2b3c4d IpAddress : 203.0.113.12 State : available Tags : {} Type : ipsec.1-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 CreateCustomerGateway。
-
- Tools for PowerShell V5
-
示例 1:此示例创建指定的客户网关。
New-EC2CustomerGateway -Type ipsec.1 -PublicIp 203.0.113.12 -BgpAsn 65534输出:
BgpAsn : 65534 CustomerGatewayId : cgw-1a2b3c4d IpAddress : 203.0.113.12 State : available Tags : {} Type : ipsec.1-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 CreateCustomerGateway。
-
CreateCapacityReservation
CreateDhcpOptions