View a markdown version of this page

Utilizzare CreateInternetGateway con una CLI - Amazon Elastic Compute Cloud

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

I seguenti esempi di codice mostrano come usare CreateInternetGateway.

Gli esempi di operazioni sono estratti di codice da programmi più grandi e devono essere eseguiti nel contesto. È possibile visualizzare questa operazione nel contesto nei seguenti esempi di codice:

CLI
AWS CLI

Come creare un gateway Internet

L’esempio create-internet-gateway seguente crea un gateway Internet con il tag Name=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 Gateway Internet nella Guida per l’utente di Amazon VPC.

PowerShell
Utensili per PowerShell V4

Esempio 1: questo esempio crea un gateway Internet.

New-EC2InternetGateway

Output:

Attachments InternetGatewayId Tags ----------- ----------------- ---- {} igw-1a2b3c4d {}
  • Per i dettagli sull'API, vedi CreateInternetGateway nel AWS Strumenti per PowerShell Riferimento al cmdlet (V4).

Utensili per PowerShell V5

Esempio 1: questo esempio crea un gateway Internet.

New-EC2InternetGateway

Output:

Attachments InternetGatewayId Tags ----------- ----------------- ---- {} igw-1a2b3c4d {}
  • Per i dettagli sull'API, vedi CreateInternetGateway nel AWS Strumenti per PowerShell Riferimento al cmdlet (V5).

Per un elenco completo di AWS Guide per sviluppatori SDK ed esempi di codice, consulta Crea EC2 risorse Amazon utilizzando un AWS SDK. Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell'SDK.