Skip to content

create_resolver_query_log_config async

create_resolver_query_log_config(
    name: ResolverQueryLogConfigName,
    destination_arn: DestinationArn,
    creator_request_id: CreatorRequestId,
    *,
    config_overrides: Optional[AsyncRoute53ResolverClientConfig] = None,
    tags: Optional[TagList] = None,
) -> CreateResolverQueryLogConfigResponse

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.

Parameters:

  • name (ResolverQueryLogConfigName) –

    The name that you want to give the query logging configuration.

  • destination_arn (DestinationArn) –

    The ARN of the resource that you want Resolver to send query logs. You can send query logs to an S3 bucket, a CloudWatch Logs log group, or a Kinesis Data Firehose delivery stream. Examples of valid values include the following:

    • S3 bucket:

      arn:aws:s3:::amzn-s3-demo-bucket

      You can optionally append a file prefix to the end of the ARN.

      arn:aws:s3:::amzn-s3-demo-bucket/development/

    • CloudWatch Logs log group:

      arn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*

    • Kinesis Data Firehose delivery stream:

      arn:aws:kinesis:us-east-2:0123456789:stream/my_stream_name

  • creator_request_id (CreatorRequestId) –

    A unique string that identifies the request and that allows failed requests to be retried without the risk of running the operation twice. CreatorRequestId can be any unique string, for example, a date/time stamp.

  • tags (Optional[TagList], default: None ) –

    A list of the tag keys and values that you want to associate with the query logging configuration.

Raises:

Source code in docs_src/capo_route53resolver/_services/async_route53_resolver.py
async def create_resolver_query_log_config(
    self,
    name: "capo_route53resolver.types.resolver_query_log_config_name.ResolverQueryLogConfigName",
    destination_arn: "capo_route53resolver.types.destination_arn.DestinationArn",
    creator_request_id: "capo_route53resolver.types.creator_request_id.CreatorRequestId",
    *,
    config_overrides: Optional[AsyncRoute53ResolverClientConfig] = None,
    tags: Optional["capo_route53resolver.types.tag_list.TagList"] = None,
) -> "capo_route53resolver.types.create_resolver_query_log_config_response.CreateResolverQueryLogConfigResponse":
    """<p>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.</p> <p>To specify which VPCs you want to log queries for, you use <code>AssociateResolverQueryLogConfig</code>. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_AssociateResolverQueryLogConfig.html">AssociateResolverQueryLogConfig</a>. </p> <p>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.</p>

    Args:
        name: <p>The name that you want to give the query logging configuration.</p>
        destination_arn: <p>The ARN of the resource that you want Resolver to send query logs. You can send query logs to an S3 bucket, a CloudWatch Logs log group, or a Kinesis Data Firehose delivery stream. Examples of valid values include the following:</p> <ul> <li> <p> <b>S3 bucket</b>: </p> <p> <code>arn:aws:s3:::amzn-s3-demo-bucket</code> </p> <p>You can optionally append a file prefix to the end of the ARN.</p> <p> <code>arn:aws:s3:::amzn-s3-demo-bucket/development/</code> </p> </li> <li> <p> <b>CloudWatch Logs log group</b>: </p> <p> <code>arn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*</code> </p> </li> <li> <p> <b>Kinesis Data Firehose delivery stream</b>:</p> <p> <code>arn:aws:kinesis:us-east-2:0123456789:stream/my_stream_name</code> </p> </li> </ul>
        creator_request_id: <p>A unique string that identifies the request and that allows failed requests to be retried without the risk of running the operation twice. <code>CreatorRequestId</code> can be any unique string, for example, a date/time stamp. </p>
        tags: <p>A list of the tag keys and values that you want to associate with the query logging configuration.</p>

    Raises:
        capo_route53resolver.errors.access_denied_exception.AccessDeniedException: <p>The current account doesn't have the IAM permissions required to perform the specified Resolver operation.</p> <p>This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.</p>
        capo_route53resolver.errors.internal_service_error_exception.InternalServiceErrorException: <p>We encountered an unknown error. Try again in a few minutes.</p>
        capo_route53resolver.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters in this request are not valid.</p>
        capo_route53resolver.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_route53resolver.errors.limit_exceeded_exception.LimitExceededException: <p>The request caused one or more limits to be exceeded.</p>
        capo_route53resolver.errors.resource_exists_exception.ResourceExistsException: <p>The resource that you tried to create already exists.</p>
        capo_route53resolver.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
        capo_route53resolver.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Try again in a few minutes.</p>
        capo_route53resolver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route53resolver.types.create_resolver_query_log_config_request.CreateResolverQueryLogConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_route53resolver.types.create_resolver_query_log_config_response.CreateResolverQueryLogConfigResponse"
    ]:
        import capo_route53resolver._operations.route53_resolver.create_resolver_query_log_config

        (
            output,
            http_response,
        ) = await capo_route53resolver._operations.route53_resolver.create_resolver_query_log_config.async_create_resolver_query_log_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateResolverQueryLogConfig")
    )
    input_: capo_route53resolver.types.create_resolver_query_log_config_request.CreateResolverQueryLogConfigRequest = {
        "name": name,
        "destination_arn": destination_arn,
        "creator_request_id": creator_request_id,
    }
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output