dhcp_options
Creates, updates, deletes or gets a dhcp_option
resource or lists dhcp_options
in a region
Overview
Name | dhcp_options |
Type | Resource |
Description | Resource Type definition for AWS::EC2::DHCPOptions |
Id | aws.ec2.dhcp_options |
Fields
Name | Datatype | Description |
---|---|---|
dhcp_options_id | string | |
domain_name | string | This value is used to complete unqualified DNS hostnames. |
domain_name_servers | array | The IPv4 addresses of up to four domain name servers, or AmazonProvidedDNS. |
netbios_name_servers | array | The IPv4 addresses of up to four NetBIOS name servers. |
netbios_node_type | integer | The NetBIOS node type (1, 2, 4, or 8). |
ntp_servers | array | The IPv4 addresses of up to four Network Time Protocol (NTP) servers. |
ipv6_address_preferred_lease_time | integer | The preferred Lease Time for ipV6 address in seconds. |
tags | array | Any tags assigned to the DHCP options set. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all dhcp_options
in a region.
SELECT
region,
dhcp_options_id,
domain_name,
domain_name_servers,
netbios_name_servers,
netbios_node_type,
ntp_servers,
ipv6_address_preferred_lease_time,
tags
FROM aws.ec2.dhcp_options
WHERE region = 'us-east-1';
Gets all properties from an individual dhcp_option
.
SELECT
region,
dhcp_options_id,
domain_name,
domain_name_servers,
netbios_name_servers,
netbios_node_type,
ntp_servers,
ipv6_address_preferred_lease_time,
tags
FROM aws.ec2.dhcp_options
WHERE region = 'us-east-1' AND data__Identifier = '<DhcpOptionsId>';
INSERT
example
Use the following StackQL query and manifest file to create a new dhcp_option
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.dhcp_options (
DomainName,
DomainNameServers,
NetbiosNameServers,
NetbiosNodeType,
NtpServers,
Ipv6AddressPreferredLeaseTime,
Tags,
region
)
SELECT
'{{ DomainName }}',
'{{ DomainNameServers }}',
'{{ NetbiosNameServers }}',
'{{ NetbiosNodeType }}',
'{{ NtpServers }}',
'{{ Ipv6AddressPreferredLeaseTime }}',
'{{ Tags }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.dhcp_options (
DomainName,
DomainNameServers,
NetbiosNameServers,
NetbiosNodeType,
NtpServers,
Ipv6AddressPreferredLeaseTime,
Tags,
region
)
SELECT
'{{ DomainName }}',
'{{ DomainNameServers }}',
'{{ NetbiosNameServers }}',
'{{ NetbiosNodeType }}',
'{{ NtpServers }}',
'{{ Ipv6AddressPreferredLeaseTime }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: dhcp_option
props:
- name: DomainName
value: '{{ DomainName }}'
- name: DomainNameServers
value:
- '{{ DomainNameServers[0] }}'
- name: NetbiosNameServers
value:
- '{{ NetbiosNameServers[0] }}'
- name: NetbiosNodeType
value: '{{ NetbiosNodeType }}'
- name: NtpServers
value:
- '{{ NtpServers[0] }}'
- name: Ipv6AddressPreferredLeaseTime
value: '{{ Ipv6AddressPreferredLeaseTime }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ec2.dhcp_options
WHERE data__Identifier = '<DhcpOptionsId>'
AND region = 'us-east-1';
Permissions
To operate on the dhcp_options
resource, the following permissions are required:
Create
ec2:CreateDhcpOptions,
ec2:DescribeDhcpOptions,
ec2:CreateTags
Read
ec2:DescribeDhcpOptions,
ec2:DescribeTags
Update
ec2:CreateTags,
ec2:DescribeDhcpOptions,
ec2:DeleteTags
Delete
ec2:DeleteDhcpOptions,
ec2:DeleteTags,
ec2:DescribeDhcpOptions
List
ec2:DescribeDhcpOptions