vpc_attributes
Creates, updates, deletes, gets or lists a vpc_attributes resource.
Overview
| Name | vpc_attributes |
| Type | Resource |
| Id | aws.ec2.vpc_attributes |
Fields
The following fields are returned by SELECT queries:
- describe_vpc_attribute
| Name | Datatype | Description |
|---|---|---|
enable_dns_hostnames | string | Indicates 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_support | string | Indicates 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_metrics | string | Indicates whether Network Address Usage metrics are enabled for your VPC. |
vpc_id | string | The ID of the VPC. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_vpc_attribute | select | Attribute, VpcId, region | DryRun | Describes the specified attribute of the specified VPC. You can specify only one attribute at a time. |
modify_vpc_attribute | update | VpcId, region | EnableDnsHostnames, EnableDnsSupport, EnableNetworkAddressUsageMetrics | Modifies 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.
| Name | Datatype | Description |
|---|---|---|
Attribute | string | The VPC attribute. |
VpcId | string | The ID of the VPC. |
region | string | AWS region (default: us-east-1) |
DryRun | boolean | Checks 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. |
EnableDnsHostnames | object | Indicates 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. |
EnableDnsSupport | object | Indicates 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. |
EnableNetworkAddressUsageMetrics | object | Indicates whether Network Address Usage metrics are enabled for your VPC. |
SELECT examples
- describe_vpc_attribute
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
- modify_vpc_attribute
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}}';