

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# CLI로 `DescribeVpnGateways` 사용
<a name="example_ec2_DescribeVpnGateways_section"></a>

다음 코드 예시는 `DescribeVpnGateways`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**가상 프라이빗 게이트웨이 설명**  
이 예시에서는 가상 프라이빗 게이트웨이를 설명합니다.  
명령:  

```
aws ec2 describe-vpn-gateways
```
출력:  

```
{
    "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"
                }
            ]
        }
    ]
}
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DescribeVpnGateways](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-vpn-gateways.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 가상 프라이빗 게이트웨이를 설명합니다.**  

```
Get-EC2VpnGateway -VpnGatewayId vgw-1a2b3c4d
```
**출력:**  

```
AvailabilityZone :
State            : available
Tags             : {}
Type             : ipsec.1
VpcAttachments   : {vpc-12345678}
VpnGatewayId     : vgw-1a2b3c4d
```
**예제 2: 이 예제에서는 상태가 pending 또는 available인 모든 가상 프라이빗 게이트웨이를 설명합니다.**  

```
$filter = New-Object Amazon.EC2.Model.Filter
$filter.Name = "state"
$filter.Values = @( "pending", "available" )

Get-EC2VpnGateway -Filter $filter
```
**예제 3: 이 예제에서는 모든 가상 프라이빗 게이트웨이를 설명합니다.**  

```
Get-EC2VpnGateway
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [DescribeVpnGateways](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 가상 프라이빗 게이트웨이를 설명합니다.**  

```
Get-EC2VpnGateway -VpnGatewayId vgw-1a2b3c4d
```
**출력:**  

```
AvailabilityZone :
State            : available
Tags             : {}
Type             : ipsec.1
VpcAttachments   : {vpc-12345678}
VpnGatewayId     : vgw-1a2b3c4d
```
**예제 2: 이 예제에서는 상태가 pending 또는 available인 모든 가상 프라이빗 게이트웨이를 설명합니다.**  

```
$filter = New-Object Amazon.EC2.Model.Filter
$filter.Name = "state"
$filter.Values = @( "pending", "available" )

Get-EC2VpnGateway -Filter $filter
```
**예제 3: 이 예제에서는 모든 가상 프라이빗 게이트웨이를 설명합니다.**  

```
Get-EC2VpnGateway
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeVpnGateways](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

 AWS SDK 개발자 안내서 및 코드 예제의 전체 목록은 섹션을 참조하세요[AWS SDK를 사용하여 Amazon EC2 리소스 생성](sdk-general-information-section.md). 이 주제에는 시작하기에 대한 정보와 이전 SDK 버전에 대한 세부 정보도 포함되어 있습니다.