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
Idawscc.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.

For more information, see AWS::EC2::DHCPOptions.

Methods

NameResourceAccessible byRequired Params
create_resourcedhcp_optionsINSERTregion
delete_resourcedhcp_optionsDELETEIdentifier, region
update_resourcedhcp_optionsUPDATEIdentifier, PatchDocument, region
list_resourcesdhcp_options_list_onlySELECTregion
get_resourcedhcp_optionsSELECTIdentifier, region

SELECT examples

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 awscc.ec2.dhcp_options
WHERE
region = 'us-east-1' AND
Identifier = '{{ dhcp_options_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new dhcp_option resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.dhcp_options (
DomainName,
DomainNameServers,
NetbiosNameServers,
NetbiosNodeType,
NtpServers,
Ipv6AddressPreferredLeaseTime,
Tags,
region
)
SELECT
'{{ domain_name }}',
'{{ domain_name_servers }}',
'{{ netbios_name_servers }}',
'{{ netbios_node_type }}',
'{{ ntp_servers }}',
'{{ ipv6_address_preferred_lease_time }}',
'{{ tags }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a dhcp_option resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.dhcp_options
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ dhcp_options_id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.dhcp_options
WHERE
Identifier = '{{ dhcp_options_id }}' AND
region = 'us-east-1';

Permissions

To operate on the dhcp_options resource, the following permissions are required:

ec2:CreateDhcpOptions,
ec2:DescribeDhcpOptions,
ec2:CreateTags