customer_gateways
Creates, updates, deletes or gets a customer_gateway resource or lists customer_gateways in a region
Overview
| Name | customer_gateways |
| Type | Resource |
| Description | Specifies a customer gateway. |
| Id | awscc.ec2.customer_gateways |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
type | string | The type of VPN connection that this customer gateway supports (ipsec.1). |
customer_gateway_id | string | |
ip_address | string | The IP address for the customer gateway device's outside interface. The address must be static. If OutsideIpAddressType in your VPN connection options is set to PrivateIpv4, you can use an RFC6598 or RFC1918 private IPv4 address. If OutsideIpAddressType is set to Ipv6, you can use an IPv6 address. |
bgp_asn_extended | number | For customer gateway devices that support BGP, specify the device's ASN. You must specify either Valid values: |
bgp_asn | integer | For customer gateway devices that support BGP, specify the device's ASN. You must specify either Default: 65000 |
tags | array | One or more tags for the customer gateway. |
certificate_arn | string | The Amazon Resource Name (ARN) for the customer gateway certificate. |
device_name | string | The name of customer gateway device. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
customer_gateway_id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::CustomerGateway.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | customer_gateways | INSERT | IpAddress, Type, region |
delete_resource | customer_gateways | DELETE | Identifier, region |
update_resource | customer_gateways | UPDATE | Identifier, PatchDocument, region |
list_resources | customer_gateways_list_only | SELECT | region |
get_resource | customer_gateways | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual customer_gateway.
SELECT
region,
type,
customer_gateway_id,
ip_address,
bgp_asn_extended,
bgp_asn,
tags,
certificate_arn,
device_name
FROM awscc.ec2.customer_gateways
WHERE
region = '{{ region }}' AND
Identifier = '{{ customer_gateway_id }}';
Lists all customer_gateways in a region.
SELECT
region,
customer_gateway_id
FROM awscc.ec2.customer_gateways_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new customer_gateway resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.customer_gateways (
Type,
IpAddress,
region
)
SELECT
'{{ type }}',
'{{ ip_address }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.customer_gateways (
Type,
IpAddress,
BgpAsnExtended,
BgpAsn,
Tags,
CertificateArn,
DeviceName,
region
)
SELECT
'{{ type }}',
'{{ ip_address }}',
'{{ bgp_asn_extended }}',
'{{ bgp_asn }}',
'{{ tags }}',
'{{ certificate_arn }}',
'{{ device_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: customer_gateway
props:
- name: type
value: '{{ type }}'
- name: ip_address
value: '{{ ip_address }}'
- name: bgp_asn_extended
value: null
- name: bgp_asn
value: '{{ bgp_asn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: certificate_arn
value: '{{ certificate_arn }}'
- name: device_name
value: '{{ device_name }}'
UPDATE example
Use the following StackQL query and manifest file to update a customer_gateway resource, using stack-deploy.
/*+ update */
UPDATE awscc.ec2.customer_gateways
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ customer_gateway_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.customer_gateways
WHERE
Identifier = '{{ customer_gateway_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the customer_gateways resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
ec2:DescribeCustomerGateways
ec2:CreateCustomerGateway,
ec2:DescribeCustomerGateways,
ec2:CreateTags
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeCustomerGateways
ec2:DescribeCustomerGateways
ec2:DeleteCustomerGateway,
ec2:DescribeCustomerGateways