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.
Parameters:
-
resolver_query_log_config_id
(ResourceId)
–
The ID of the query logging configuration that you want to associate a VPC with.
-
resource_id
(ResourceId)
–
The ID of an Amazon VPC that you want this query logging configuration to log queries for.
The VPCs and the query logging configuration must be in the same Region.
Raises:
Source code in docs_src/capo_route53resolver/_services/async_route53_resolver.py
| async def associate_resolver_query_log_config(
self,
resolver_query_log_config_id: "capo_route53resolver.types.resource_id.ResourceId",
resource_id: "capo_route53resolver.types.resource_id.ResourceId",
*,
config_overrides: Optional[AsyncRoute53ResolverClientConfig] = None,
) -> "capo_route53resolver.types.associate_resolver_query_log_config_response.AssociateResolverQueryLogConfigResponse":
"""<p>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 <code>AssociateResolverQueryLogConfig</code> request for each VPC.</p> <note> <p>The VPCs that you associate with a query logging configuration must be in the same Region as the configuration.</p> </note> <p>To remove a VPC from a query logging configuration, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_DisassociateResolverQueryLogConfig.html">DisassociateResolverQueryLogConfig</a>. </p>
Args:
resolver_query_log_config_id: <p>The ID of the query logging configuration that you want to associate a VPC with.</p>
resource_id: <p>The ID of an Amazon VPC that you want this query logging configuration to log queries for.</p> <note> <p>The VPCs and the query logging configuration must be in the same Region.</p> </note>
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.associate_resolver_query_log_config_request.AssociateResolverQueryLogConfigRequest]",
) -> AsyncOperationResponse[
"capo_route53resolver.types.associate_resolver_query_log_config_response.AssociateResolverQueryLogConfigResponse"
]:
import capo_route53resolver._operations.route53_resolver.associate_resolver_query_log_config
(
output,
http_response,
) = await capo_route53resolver._operations.route53_resolver.associate_resolver_query_log_config.async_associate_resolver_query_log_config(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateResolverQueryLogConfig")
)
input_: capo_route53resolver.types.associate_resolver_query_log_config_request.AssociateResolverQueryLogConfigRequest = {
"resolver_query_log_config_id": resolver_query_log_config_id,
"resource_id": resource_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|