Skip to main content

dhcp_options

Creates, updates, deletes or gets a dhcp_option resource or lists dhcp_options in a region

Overview

Namedhcp_options
TypeResource
DescriptionResource Type definition for AWS::EC2::DHCPOptions
Idaws.ec2.dhcp_options

Fields

NameDatatypeDescription
dhcp_options_idstring
domain_namestringThis value is used to complete unqualified DNS hostnames.
domain_name_serversarrayThe IPv4 addresses of up to four domain name servers, or AmazonProvidedDNS.
netbios_name_serversarrayThe IPv4 addresses of up to four NetBIOS name servers.
netbios_node_typeintegerThe NetBIOS node type (1, 2, 4, or 8).
ntp_serversarrayThe IPv4 addresses of up to four Network Time Protocol (NTP) servers.
ipv6_address_preferred_lease_timeintegerThe preferred Lease Time for ipV6 address in seconds.
tagsarrayAny tags assigned to the DHCP options set.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.ec2.dhcp_options (
DomainName,
DomainNameServers,
NetbiosNameServers,
NetbiosNodeType,
NtpServers,
Ipv6AddressPreferredLeaseTime,
Tags,
region
)
SELECT
'{{ DomainName }}',
'{{ DomainNameServers }}',
'{{ NetbiosNameServers }}',
'{{ NetbiosNodeType }}',
'{{ NtpServers }}',
'{{ Ipv6AddressPreferredLeaseTime }}',
'{{ Tags }}',
'{{ region }}';

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