Skip to main content

vpc_attributes

Creates, updates, deletes, gets or lists a vpc_attributes resource.

Overview

Namevpc_attributes
TypeResource
Idaws.ec2.vpc_attributes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
enable_dns_hostnamesstringIndicates whether the instances launched in the VPC get DNS hostnames. If this attribute is true, instances in the VPC get DNS hostnames; otherwise, they do not.
enable_dns_supportstringIndicates whether DNS resolution is enabled for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not.
enable_network_address_usage_metricsstringIndicates whether Network Address Usage metrics are enabled for your VPC.
vpc_idstringThe ID of the VPC.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_vpc_attributeselectAttribute, VpcId, regionDryRunDescribes the specified attribute of the specified VPC. You can specify only one attribute at a time.
modify_vpc_attributeupdateVpcId, regionEnableDnsHostnames, EnableDnsSupport, EnableNetworkAddressUsageMetricsModifies the specified attribute of the specified VPC.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
AttributestringThe VPC attribute.
VpcIdstringThe ID of the VPC.
regionstringAWS region (default: us-east-1)
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
EnableDnsHostnamesobjectIndicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.
EnableDnsSupportobjectIndicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute.
EnableNetworkAddressUsageMetricsobjectIndicates whether Network Address Usage metrics are enabled for your VPC.

SELECT examples

Describes the specified attribute of the specified VPC. You can specify only one attribute at a time.

SELECT
enable_dns_hostnames,
enable_dns_support,
enable_network_address_usage_metrics,
vpc_id
FROM aws.ec2.vpc_attributes
WHERE Attribute = '{{ Attribute }}' -- required
AND VpcId = '{{ VpcId }}' -- required
AND region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
;

UPDATE examples

Modifies the specified attribute of the specified VPC.

UPDATE aws.ec2.vpc_attributes
SET
-- No updatable properties
WHERE
VpcId = '{{ VpcId }}' --required
AND region = '{{ region }}' --required
AND EnableDnsHostnames = '{{ EnableDnsHostnames}}'
AND EnableDnsSupport = '{{ EnableDnsSupport}}'
AND EnableNetworkAddressUsageMetrics = '{{ EnableNetworkAddressUsageMetrics}}';