Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzare CreateInternetGateway
con una CLI
Gli esempi di codice seguenti mostrano come utilizzare CreateInternetGateway
.
- CLI
-
- AWS CLI
-
Per creare un gateway Internet
L'
create-internet-gateway
esempio seguente crea un gateway Internet con il tagName=my-igw
.aws ec2 create-internet-gateway \ --tag-specifications
ResourceType=internet-gateway,Tags=[{Key=Name,Value=my-igw}]
Output:
{ "InternetGateway": { "Attachments": [], "InternetGatewayId": "igw-0d0fb496b3994d755", "OwnerId": "123456789012", "Tags": [ { "Key": "Name", "Value": "my-igw" } ] } }
Per ulteriori informazioni, consulta la sezione Gateway Internet nella Guida per l'utente di Amazon VPC.
-
Per i dettagli sull'API, vedere CreateInternetGateway
in AWS CLI Command Reference.
-
- PowerShell
-
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio crea un gateway Internet.
New-EC2InternetGateway
Output:
Attachments InternetGatewayId Tags ----------- ----------------- ---- {} igw-1a2b3c4d {}
-
Per i dettagli sull'API, vedere CreateInternetGatewayin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
- Strumenti per V5 PowerShell
-
Esempio 1: Questo esempio crea un gateway Internet.
New-EC2InternetGateway
Output:
Attachments InternetGatewayId Tags ----------- ----------------- ---- {} igw-1a2b3c4d {}
-
Per i dettagli sull'API, vedere CreateInternetGatewayin AWS Strumenti per PowerShell Cmdlet Reference (V5).
-