Utilizzare DescribeInternetGateways con una CLI - Esempi di codice per SDK AWS

Sono disponibili altri esempi per SDK AWS nel repository GitHub della documentazione degli esempi per SDK AWS.

Utilizzare DescribeInternetGateways con una CLI

Gli esempi di codice seguenti mostrano come utilizzare DescribeInternetGateways.

Gli esempi di operazioni sono estratti di codice da programmi più grandi e devono essere eseguiti nel contesto. Puoi vedere questa azione nel contesto nel seguente esempio di codice:

CLI
AWS CLI

Come descrivere un gateway Internet

L’esempio describe-internet-gateways seguente descrive il gateway Internet specificato.

aws ec2 describe-internet-gateways \ --internet-gateway-ids igw-0d0fb496b3EXAMPLE

Output:

{ "InternetGateways": [ { "Attachments": [ { "State": "available", "VpcId": "vpc-0a60eb65b4EXAMPLE" } ], "InternetGatewayId": "igw-0d0fb496b3EXAMPLE", "OwnerId": "123456789012", "Tags": [ { "Key": "Name", "Value": "my-igw" } ] } ] }

Per ulteriori informazioni, consulta Gateway Internet nella Guida per l’utente di Amazon VPC.

PowerShell
Strumenti per PowerShell V4

Esempio 1: questo esempio descrive il gateway Internet specificato.

Get-EC2InternetGateway -InternetGatewayId igw-1a2b3c4d

Output:

Attachments InternetGatewayId Tags ----------- ----------------- ---- {vpc-1a2b3c4d} igw-1a2b3c4d {}

Esempio 2: questo esempio descrive tutti i gateway Internet specificati.

Get-EC2InternetGateway

Output:

Attachments InternetGatewayId Tags ----------- ----------------- ---- {vpc-1a2b3c4d} igw-1a2b3c4d {} {} igw-2a3b4c5d {}
  • Per informazioni dettagliate sull’API, consulta DescribeInternetGateways nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V4).

Strumenti per PowerShell V5

Esempio 1: questo esempio descrive il gateway Internet specificato.

Get-EC2InternetGateway -InternetGatewayId igw-1a2b3c4d

Output:

Attachments InternetGatewayId Tags ----------- ----------------- ---- {vpc-1a2b3c4d} igw-1a2b3c4d {}

Esempio 2: questo esempio descrive tutti i gateway Internet specificati.

Get-EC2InternetGateway

Output:

Attachments InternetGatewayId Tags ----------- ----------------- ---- {vpc-1a2b3c4d} igw-1a2b3c4d {} {} igw-2a3b4c5d {}
  • Per informazioni dettagliate sull’API, consulta DescribeInternetGateways nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V5).