Table: aws_vpc_dhcp_options - Query AWS VPC DHCP Options using SQL
The AWS VPC DHCP Options is a feature within Amazon's Virtual Private Cloud (VPC) that allows you to configure Domain Name System (DNS) settings for your instances that get their IP addresses from a DHCP set. You can specify DNS servers and domain names that Amazon EC2 instances use when they're launched in your VPC. DHCP options sets provide a simple way to manage DNS settings consistently across your entire VPC, enhancing the overall network management.
Table Usage Guide
The aws_vpc_dhcp_options
table in Steampipe provides you with information about DHCP Options associated with Virtual Private Cloud (VPC) within Amazon Web Services (AWS). This table allows you, as a network administrator or DevOps engineer, to query DHCP Options specific details, including domain name servers, domain name, NTP servers, and associated metadata. You can utilize this table to gather insights on DHCP Options, such as the configured domain name servers, NTP servers, and NetBIOS name servers. The schema outlines the various attributes of the DHCP Options for you, including the DHCP Options ID, domain name, domain name servers, NTP servers, NetBIOS name servers, NetBIOS node type, and associated tags.
Examples
DHCP options configuration parameters info
Analyze the settings to understand the configuration of DHCP options within your AWS VPC. This is useful for maintaining network stability and optimizing domain and server configurations.
select dhcp_options_id, domain_name, domain_name_servers, netbios_name_servers, netbios_node_type, ntp_serversfrom aws_vpc_dhcp_options;
select dhcp_options_id, domain_name, domain_name_servers, netbios_name_servers, netbios_node_type, ntp_serversfrom aws_vpc_dhcp_options;
List DHCP options which are not using AWS provided DNS
Discover the segments that are not utilizing the DNS provided by AWS in their DHCP options. This could be useful to ensure compliance with company policies or to identify potential areas for optimization.
select dhcp_options_id, domain_name, domain_name_serversfrom aws_vpc_dhcp_optionswhere domain_name_servers ? 'AmazonProvidedDNS';
select dhcp_options_id, domain_name, domain_name_serversfrom aws_vpc_dhcp_optionswhere json_extract(domain_name_servers, '$.AmazonProvidedDNS') is not null;
List all DHCP options without desired netbios (for example 2 - P-node is desired) node type
This query is used to identify the DHCP options that are not configured with the desired netbios node type, in this case, P-node. This can help in managing network settings efficiently by pinpointing those options that may need to be updated to ensure optimal network performance.
select dhcp_options_id, netbios_node_typefrom aws_vpc_dhcp_options cross join jsonb_array_elements_text(netbios_node_type) as iwhere not i.value :: int in (2);
select dhcp_options_id, json_extract(i.value, '$') as netbios_node_typefrom aws_vpc_dhcp_options, json_each(netbios_node_type) as iwhere cast(json_extract(i.value, '$') as int) not in (2);
Schema for aws_vpc_dhcp_options
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
dhcp_options_id | text | = | The ID of the set of DHCP options. |
domain_name | jsonb | The domain name for instances. This value is used to complete unqualified DNS hostnames. | |
domain_name_servers | jsonb | The IP addresses of up to four domain name servers, or AmazonProvidedDNS. | |
netbios_name_servers | jsonb | The IP addresses of up to four NetBIOS name servers. | |
netbios_node_type | jsonb | The NetBIOS node type (1, 2, 4, or 8). | |
ntp_servers | jsonb | The IP addresses of up to four Network Time Protocol (NTP) servers. | |
owner_id | text | = | The ID of the AWS account that owns the DHCP options set. |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags that are attached to vpc dhcp options. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_vpc_dhcp_options