Skip to main content

resolver_query_log_configs

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

Overview

Nameresolver_query_log_configs
TypeResource
Idaws.route53resolver.resolver_query_log_configs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN for the query logging configuration.
association_countintegerThe number of VPCs that are associated with the query logging configuration.
creation_timestringThe date and time that the query logging configuration was created, in Unix time format and Coordinated Universal Time (UTC).
creator_request_idstringA unique string that identifies the request that created the query logging configuration. The CreatorRequestId allows failed requests to be retried without the risk of running the operation twice.
destination_arnstringThe ARN of the resource that you want Resolver to send query logs: an Amazon S3 bucket, a CloudWatch Logs log group, or a Kinesis Data Firehose delivery stream.
idstringThe ID for the query logging configuration.
namestringThe name of the query logging configuration. (pattern: <code>(?!^[0-9]+$)([a-zA-Z0-9-_' ']+)</code>)
owner_idstringThe Amazon Web Services account ID for the account that created the query logging configuration.
share_statusstringAn indication of whether the query logging configuration is shared with other Amazon Web Services accounts, or was shared with the current account by another Amazon Web Services account. Sharing is configured through Resource Access Manager (RAM). (NOT_SHARED, SHARED_WITH_ME, SHARED_BY_ME)
statusstringThe status of the specified query logging configuration. Valid values include the following: CREATING: Resolver is creating the query logging configuration. CREATED: The query logging configuration was successfully created. Resolver is logging queries that originate in the specified VPC. DELETING: Resolver is deleting this query logging configuration. FAILED: Resolver can't deliver logs to the location that is specified in the query logging configuration. Here are two common causes: The specified destination (for example, an Amazon S3 bucket) was deleted. Permissions don't allow sending logs to the destination. (CREATING, CREATED, DELETING, FAILED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resolver_query_log_configselectregionGets information about a specified Resolver query logging configuration, such as the number of VPCs that the configuration is logging queries for and the location that logs are sent to.
list_resolver_query_log_configsselectregionLists information about the specified query logging configurations. Each configuration defines where you want Resolver to save DNS query logs and specifies the VPCs that you want to log queries for.
create_resolver_query_log_configinsertregion, DestinationArn, CreatorRequestIdCreates a Resolver query logging configuration, which defines where you want Resolver to save DNS query logs that originate in your VPCs. Resolver can log queries only for VPCs that are in the same Region as the query logging configuration. To specify which VPCs you want to log queries for, you use AssociateResolverQueryLogConfig. For more information, see AssociateResolverQueryLogConfig. You can optionally use Resource Access Manager (RAM) to share a query logging configuration with other Amazon Web Services accounts. The other accounts can then associate VPCs with the configuration. The query logs that Resolver creates for a configuration include all DNS queries that originate in all VPCs that are associated with the configuration.
associate_resolver_query_log_configupdateregion, ResolverQueryLogConfigId, ResourceIdAssociates an Amazon VPC with a specified query logging configuration. Route 53 Resolver logs DNS queries that originate in all of the Amazon VPCs that are associated with a specified query logging configuration. To associate more than one VPC with a configuration, submit one AssociateResolverQueryLogConfig request for each VPC. The VPCs that you associate with a query logging configuration must be in the same Region as the configuration. To remove a VPC from a query logging configuration, see DisassociateResolverQueryLogConfig.
delete_resolver_query_log_configdeleteregionDeletes a query logging configuration. When you delete a configuration, Resolver stops logging DNS queries for all of the Amazon VPCs that are associated with the configuration. This also applies if the query logging configuration is shared with other Amazon Web Services accounts, and the other accounts have associated VPCs with the shared configuration. Before you can delete a query logging configuration, you must first disassociate all VPCs from the configuration. See DisassociateResolverQueryLogConfig. If you used Resource Access Manager (RAM) to share a query logging configuration with other accounts, you must stop sharing the configuration before you can delete a configuration. The accounts that you shared the configuration with can first disassociate VPCs that they associated with the configuration, but that's not necessary. If you stop sharing the configuration, those VPCs are automatically disassociated from the configuration.
disassociate_resolver_query_log_configexecregion, ResolverQueryLogConfigId, ResourceIdDisassociates a VPC from a query logging configuration. Before you can delete a query logging configuration, you must first disassociate all VPCs from the configuration. If you used Resource Access Manager (RAM) to share a query logging configuration with other accounts, VPCs can be disassociated from the configuration in the following ways: The accounts that you shared the configuration with can disassociate VPCs from the configuration. You can stop sharing the configuration.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Gets information about a specified Resolver query logging configuration, such as the number of VPCs that the configuration is logging queries for and the location that logs are sent to.

SELECT
arn,
association_count,
creation_time,
creator_request_id,
destination_arn,
id,
name,
owner_id,
share_status,
status
FROM aws.route53resolver.resolver_query_log_configs
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a Resolver query logging configuration, which defines where you want Resolver to save DNS query logs that originate in your VPCs. Resolver can log queries only for VPCs that are in the same Region as the query logging configuration. To specify which VPCs you want to log queries for, you use AssociateResolverQueryLogConfig. For more information, see AssociateResolverQueryLogConfig. You can optionally use Resource Access Manager (RAM) to share a query logging configuration with other Amazon Web Services accounts. The other accounts can then associate VPCs with the configuration. The query logs that Resolver creates for a configuration include all DNS queries that originate in all VPCs that are associated with the configuration.

INSERT INTO aws.route53resolver.resolver_query_log_configs (
Name,
DestinationArn,
CreatorRequestId,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ DestinationArn }}' /* required */,
'{{ CreatorRequestId }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
resolver_query_log_config
;

UPDATE examples

Associates an Amazon VPC with a specified query logging configuration. Route 53 Resolver logs DNS queries that originate in all of the Amazon VPCs that are associated with a specified query logging configuration. To associate more than one VPC with a configuration, submit one AssociateResolverQueryLogConfig request for each VPC. The VPCs that you associate with a query logging configuration must be in the same Region as the configuration. To remove a VPC from a query logging configuration, see DisassociateResolverQueryLogConfig.

UPDATE aws.route53resolver.resolver_query_log_configs
SET
ResolverQueryLogConfigId = '{{ ResolverQueryLogConfigId }}',
ResourceId = '{{ ResourceId }}'
WHERE
region = '{{ region }}' --required
AND ResolverQueryLogConfigId = '{{ ResolverQueryLogConfigId }}' --required
AND ResourceId = '{{ ResourceId }}' --required
RETURNING
resolver_query_log_config_association;

DELETE examples

Deletes a query logging configuration. When you delete a configuration, Resolver stops logging DNS queries for all of the Amazon VPCs that are associated with the configuration. This also applies if the query logging configuration is shared with other Amazon Web Services accounts, and the other accounts have associated VPCs with the shared configuration. Before you can delete a query logging configuration, you must first disassociate all VPCs from the configuration. See DisassociateResolverQueryLogConfig. If you used Resource Access Manager (RAM) to share a query logging configuration with other accounts, you must stop sharing the configuration before you can delete a configuration. The accounts that you shared the configuration with can first disassociate VPCs that they associated with the configuration, but that's not necessary. If you stop sharing the configuration, those VPCs are automatically disassociated from the configuration.

DELETE FROM aws.route53resolver.resolver_query_log_configs
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Disassociates a VPC from a query logging configuration. Before you can delete a query logging configuration, you must first disassociate all VPCs from the configuration. If you used Resource Access Manager (RAM) to share a query logging configuration with other accounts, VPCs can be disassociated from the configuration in the following ways: The accounts that you shared the configuration with can disassociate VPCs from the configuration. You can stop sharing the configuration.

EXEC aws.route53resolver.resolver_query_log_configs.disassociate_resolver_query_log_config
@region='{{ region }}' --required
@@json=
'{
"ResolverQueryLogConfigId": "{{ ResolverQueryLogConfigId }}",
"ResourceId": "{{ ResourceId }}"
}'
;