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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.dhcp_options
WHERE
Identifier = '{{ dhcp_options_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:

ParameterDescription
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 dhcp_options resource, the following permissions are required:

ec2:CreateDhcpOptions,
ec2:DescribeDhcpOptions,
ec2:CreateTags