Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use DescribeVpnGateways
with a CLI
The following code examples show how to use DescribeVpnGateways
.
- CLI
-
- Amazon CLI
-
To describe your virtual private gateways
This example describes your virtual private gateways.
Command:
aws ec2 describe-vpn-gateways
Output:
{
"VpnGateways": [
{
"State": "available",
"Type": "ipsec.1",
"VpnGatewayId": "vgw-f211f09b",
"VpcAttachments": [
{
"State": "attached",
"VpcId": "vpc-98eb5ef5"
}
]
},
{
"State": "available",
"Type": "ipsec.1",
"VpnGatewayId": "vgw-9a4cacf3",
"VpcAttachments": [
{
"State": "attaching",
"VpcId": "vpc-a01106c2"
}
]
}
]
}
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example describes the specified virtual private gateway.
Get-EC2VpnGateway -VpnGatewayId vgw-1a2b3c4d
Output:
AvailabilityZone :
State : available
Tags : {}
Type : ipsec.1
VpcAttachments : {vpc-12345678}
VpnGatewayId : vgw-1a2b3c4d
Example 2: This example describes any virtual private gateway whose state is either pending or available.
$filter = New-Object Amazon.EC2.Model.Filter
$filter.Name = "state"
$filter.Values = @( "pending", "available" )
Get-EC2VpnGateway -Filter $filter
Example 3: This example describes all your virtual private gateways.
Get-EC2VpnGateway
For a complete list of Amazon SDK developer guides and code examples, see
Create Amazon EC2 resources using an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.