Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan CreateCustomerGateway
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanCreateCustomerGateway
.
- CLI
-
- AWS CLI
-
Untuk membuat gateway pelanggan
Contoh ini membuat gateway pelanggan dengan alamat IP yang ditentukan untuk antarmuka luarnya.
Perintah:
aws ec2 create-customer-gateway --type
ipsec.1
--public-ip12.1.2.3
--bgp-asn65534
Output:
{ "CustomerGateway": { "CustomerGatewayId": "cgw-0e11f167", "IpAddress": "12.1.2.3", "State": "available", "Type": "ipsec.1", "BgpAsn": "65534" } }
-
Untuk detail API, lihat CreateCustomerGateway
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Contoh ini membuat gateway pelanggan yang ditentukan.
New-EC2CustomerGateway -Type ipsec.1 -PublicIp 203.0.113.12 -BgpAsn 65534
Output:
BgpAsn : 65534 CustomerGatewayId : cgw-1a2b3c4d IpAddress : 203.0.113.12 State : available Tags : {} Type : ipsec.1
-
Untuk detail API, lihat CreateCustomerGatewaydi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini membuat gateway pelanggan yang ditentukan.
New-EC2CustomerGateway -Type ipsec.1 -PublicIp 203.0.113.12 -BgpAsn 65534
Output:
BgpAsn : 65534 CustomerGatewayId : cgw-1a2b3c4d IpAddress : 203.0.113.12 State : available Tags : {} Type : ipsec.1
-
Untuk detail API, lihat CreateCustomerGatewaydi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-