

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
<a name="example_ec2_CreateInternetGateway_section"></a>

Gli esempi di codice seguenti mostrano come utilizzare `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: 
+  [Creare un VPC con sottoreti private e gateway NAT](example_vpc_GettingStartedPrivate_section.md) 
+  [Nozioni di base su Amazon VPC](example_vpc_GettingStartedCLI_section.md) 

------
#### [ 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](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html) nella *Guida per l’utente di Amazon VPC*.  
+  Per i dettagli sull'API, consulta [CreateInternetGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-internet-gateway.html)*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 [CreateInternetGateway](https://docs.aws.amazon.com/powershell/v4/reference)in *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 [CreateInternetGateway](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

------

Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, consulta. [Crea EC2 risorse Amazon utilizzando un AWS SDK](sdk-general-information-section.md) Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.