vpcdhcp_options_associations
Used to retrieve a list of vpcdhcp_options_associations
in a region or to create or delete a vpcdhcp_options_associations
resource, use vpcdhcp_options_association
to read or update an individual resource.
Overview
Name | vpcdhcp_options_associations |
Type | Resource |
Description | Associates a set of DHCP options with a VPC, or associates no DHCP options with the VPC. |
Id | aws.ec2.vpcdhcp_options_associations |
Fields
Name | Datatype | Description |
---|---|---|
dhcp_options_id | string | The ID of the DHCP options set, or default to associate no DHCP options with the VPC. |
vpc_id | string | The ID of the VPC. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | VpcId, DhcpOptionsId, region |
delete_resource | DELETE | data__Identifier, region |
list_resource | SELECT | region |
SELECT
Example
SELECT
region,
dhcp_options_id,
vpc_id
FROM aws.ec2.vpcdhcp_options_associations
WHERE region = 'us-east-1';
INSERT
Example
Use the following StackQL query and manifest file to create a new vpcdhcp_options_association
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.vpcdhcp_options_associations (
DhcpOptionsId,
VpcId,
region
)
SELECT
'{{ DhcpOptionsId }}',
'{{ VpcId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.vpcdhcp_options_associations (
DhcpOptionsId,
VpcId,
region
)
SELECT
'{{ DhcpOptionsId }}',
'{{ VpcId }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: vpcdhcp_options_association
props:
- name: DhcpOptionsId
value: '{{ DhcpOptionsId }}'
- name: VpcId
value: '{{ VpcId }}'
DELETE
Example
/*+ delete */
DELETE FROM aws.ec2.vpcdhcp_options_associations
WHERE data__Identifier = '<DhcpOptionsId|VpcId>'
AND region = 'us-east-1';
Permissions
To operate on the vpcdhcp_options_associations
resource, the following permissions are required:
Create
ec2:AssociateDhcpOptions
Delete
ec2:AssociateDhcpOptions
List
ec2:DescribeVpcs