AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제
CLI로 AttachVpnGateway 사용
다음 코드 예시는 AttachVpnGateway의 사용 방법을 보여 줍니다.
- CLI
-
- AWS CLI
-
VPC에 가상 프라이빗 게이트웨이 연결
다음
attach-vpn-gateway예시에서는 지정된 가상 프라이빗 게이트웨이를 지정된 VPC에 연결합니다.aws ec2 attach-vpn-gateway \ --vpn-gateway-idvgw-9a4cacf3\ --vpc-idvpc-a01106c2출력:
{ "VpcAttachment": { "State": "attaching", "VpcId": "vpc-a01106c2" } }-
API 세부 정보는 AWS CLI 명령 참조의 AttachVpnGateway
섹션을 참조하세요.
-
- PowerShell
-
- Tools for PowerShell V4
-
예제 1: 이 예제에서는 지정된 가상 프라이빗 게이트웨이를 지정된 VPC에 연결합니다.
Add-EC2VpnGateway -VpnGatewayId vgw-1a2b3c4d -VpcId vpc-12345678출력:
State VpcId ----- ----- attaching vpc-12345678-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)의 AttachVpnGateway를 참조하세요.
-
- Tools for PowerShell V5
-
예제 1: 이 예제에서는 지정된 가상 프라이빗 게이트웨이를 지정된 VPC에 연결합니다.
Add-EC2VpnGateway -VpnGatewayId vgw-1a2b3c4d -VpcId vpc-12345678출력:
State VpcId ----- ----- attaching vpc-12345678-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)의 AttachVpnGateway를 참조하세요.
-
AttachVolume
AuthorizeSecurityGroupEgress