vpn_gateways
Creates, updates, deletes, gets or lists a vpn_gateways resource.
Overview
| Name | vpn_gateways |
| Type | Resource |
| Id | aws.ec2.vpn_gateways |
Fields
The following fields are returned by SELECT queries:
- describe_vpn_gateways
| Name | Datatype | Description |
|---|---|---|
amazon_side_asn | integer | The private Autonomous System Number (ASN) for the Amazon side of a BGP session. |
availability_zone | string | The Availability Zone where the virtual private gateway was created, if applicable. This field may be empty or not returned. |
state | string | The current state of the virtual private gateway. |
tags | string | Any tags assigned to the virtual private gateway. |
type | string | The type of VPN connection the virtual private gateway supports. |
vpc_attachments | string | Any VPCs attached to the virtual private gateway. |
vpn_gateway_id | string | The ID of the virtual private gateway. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_vpn_gateways | select | region | Filter, VpnGatewayId, DryRun | Describes one or more of your virtual private gateways. For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide. |
create_vpn_gateway | insert | region | AvailabilityZone, Type, TagSpecification, AmazonSideAsn, DryRun | Creates a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself. For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide. |
attach_vpn_gateway | update | VpcId, VpnGatewayId, region | DryRun | Attaches an available virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time. For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide. |
delete_vpn_gateway | delete | VpnGatewayId, region | DryRun | Deletes the specified virtual private gateway. You must first detach the virtual private gateway from the VPC. Note that you don't need to delete the virtual private gateway if you plan to delete and recreate the VPN connection between your VPC and your network. |
detach_vpn_gateway | exec | VpcId, VpnGatewayId, region | DryRun | Detaches a virtual private gateway from a VPC. You do this if you're planning to turn off the VPC and not use it anymore. You can confirm a virtual private gateway has been completely detached from a VPC by describing the virtual private gateway (any attachments to the virtual private gateway are also described). You must wait for the attachment's state to switch to detached before you can delete the VPC or attach a different VPC to the virtual private gateway. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
VpcId | string | The ID of the VPC. |
VpnGatewayId | string | The ID of the virtual private gateway. |
region | string | AWS region (default: us-east-1) |
AmazonSideAsn | integer (int64) | A private Autonomous System Number (ASN) for the Amazon side of a BGP session. If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range. Default: 64512 |
AvailabilityZone | string | The Availability Zone for the virtual private gateway. |
DryRun | boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
Filter | array | One or more filters. amazon-side-asn - The Autonomous System Number (ASN) for the Amazon side of the gateway. attachment.state - The current state of the attachment between the gateway and the VPC (attaching | attached | detaching | detached). attachment.vpc-id - The ID of an attached VPC. availability-zone - The Availability Zone for the virtual private gateway (if applicable). state - The state of the virtual private gateway (pending | available | deleting | deleted). tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value. type - The type of virtual private gateway. Currently the only supported type is ipsec.1. vpn-gateway-id - The ID of the virtual private gateway. |
TagSpecification | array | The tags to apply to the virtual private gateway. |
Type | string | The type of VPN connection this virtual private gateway supports. |
VpnGatewayId | array | One or more virtual private gateway IDs. Default: Describes all your virtual private gateways. |
SELECT examples
- describe_vpn_gateways
Describes one or more of your virtual private gateways. For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide.
SELECT
amazon_side_asn,
availability_zone,
state,
tags,
type,
vpc_attachments,
vpn_gateway_id
FROM aws.ec2.vpn_gateways
WHERE region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND VpnGatewayId = '{{ VpnGatewayId }}'
AND DryRun = '{{ DryRun }}'
;
INSERT examples
- create_vpn_gateway
- Manifest
Creates a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself. For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide.
INSERT INTO aws.ec2.vpn_gateways (
region,
AvailabilityZone,
Type,
TagSpecification,
AmazonSideAsn,
DryRun
)
SELECT
'{{ region }}',
'{{ AvailabilityZone }}',
'{{ Type }}',
'{{ TagSpecification }}',
'{{ AmazonSideAsn }}',
'{{ DryRun }}'
RETURNING
amazon_side_asn,
availability_zone,
state,
tags,
type,
vpc_attachments,
vpn_gateway_id
;
# Description fields are for documentation purposes
- name: vpn_gateways
props:
- name: region
value: "{{ region }}"
description: Required parameter for the vpn_gateways resource.
- name: AvailabilityZone
value: "{{ AvailabilityZone }}"
description: The Availability Zone for the virtual private gateway.
description: The Availability Zone for the virtual private gateway.
- name: Type
value: "{{ Type }}"
description: The type of VPN connection this virtual private gateway supports.
description: The type of VPN connection this virtual private gateway supports.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to apply to the virtual private gateway.
description: The tags to apply to the virtual private gateway.
- name: AmazonSideAsn
value: "{{ AmazonSideAsn }}"
description: A private Autonomous System Number (ASN) for the Amazon side of a BGP session. If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range. Default: 64512
description: A private Autonomous System Number (ASN) for the Amazon side of a BGP session. If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range. Default: 64512
- name: DryRun
value: {{ DryRun }}
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
UPDATE examples
- attach_vpn_gateway
Attaches an available virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time. For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide.
UPDATE aws.ec2.vpn_gateways
SET
-- No updatable properties
WHERE
VpcId = '{{ VpcId }}' --required
AND VpnGatewayId = '{{ VpnGatewayId }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
RETURNING
state,
vpc_id;
DELETE examples
- delete_vpn_gateway
Deletes the specified virtual private gateway. You must first detach the virtual private gateway from the VPC. Note that you don't need to delete the virtual private gateway if you plan to delete and recreate the VPN connection between your VPC and your network.
DELETE FROM aws.ec2.vpn_gateways
WHERE VpnGatewayId = '{{ VpnGatewayId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;
Lifecycle Methods
- detach_vpn_gateway
Detaches a virtual private gateway from a VPC. You do this if you're planning to turn off the VPC and not use it anymore. You can confirm a virtual private gateway has been completely detached from a VPC by describing the virtual private gateway (any attachments to the virtual private gateway are also described). You must wait for the attachment's state to switch to detached before you can delete the VPC or attach a different VPC to the virtual private gateway.
EXEC aws.ec2.vpn_gateways.detach_vpn_gateway
@VpcId='{{ VpcId }}' --required,
@VpnGatewayId='{{ VpnGatewayId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;