Skip to content

delete_vpc_association_authorization

delete_vpc_association_authorization(
    hosted_zone_id: ResourceId,
    vpc: VPC,
    *,
    config_overrides: Optional[Route53ClientConfig] = None,
) -> DeleteVPCAssociationAuthorizationResponse

Removes authorization to submit an AssociateVPCWithHostedZone request to associate a specified VPC with a hosted zone that was created by a different account. You must use the account that created the hosted zone to submit a DeleteVPCAssociationAuthorization request.

Sending this request only prevents the Amazon Web Services account that created the VPC from associating the VPC with the Amazon Route 53 hosted zone in the future. If the VPC is already associated with the hosted zone, DeleteVPCAssociationAuthorization won't disassociate the VPC from the hosted zone. If you want to delete an existing association, use DisassociateVPCFromHostedZone.

Parameters:

  • hosted_zone_id (ResourceId) –

    When removing authorization to associate a VPC that was created by one Amazon Web Services account with a hosted zone that was created with a different Amazon Web Services account, the ID of the hosted zone.

  • vpc (VPC) –

    When removing authorization to associate a VPC that was created by one Amazon Web Services account with a hosted zone that was created with a different Amazon Web Services account, a complex type that includes the ID and region of the VPC.

Raises:

  • ConcurrentModification –

    Another user submitted a request to create, update, or delete the object at the same time that you did. Retry the request.

  • InvalidInput –

    The input is not valid.

  • InvalidVPCId –

    The VPC ID that you specified either isn't a valid ID or the current account is not authorized to access this VPC.

  • NoSuchHostedZone –

    No hosted zone exists with the ID that you specified.

  • VPCAssociationAuthorizationNotFound –

    The VPC that you specified is not authorized to be associated with the hosted zone.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_route_53/_services/route53.py
def delete_vpc_association_authorization(
    self,
    hosted_zone_id: "capo_route_53.types.resource_id.ResourceId",
    vpc: "capo_route_53.types.vpc.VPC",
    *,
    config_overrides: Optional[Route53ClientConfig] = None,
) -> "capo_route_53.types.delete_vpc_association_authorization_response.DeleteVPCAssociationAuthorizationResponse":
    """<p>Removes authorization to submit an <code>AssociateVPCWithHostedZone</code> request to associate a specified VPC with a hosted zone that was created by a different account. You must use the account that created the hosted zone to submit a <code>DeleteVPCAssociationAuthorization</code> request.</p> <important> <p>Sending this request only prevents the Amazon Web Services account that created the VPC from associating the VPC with the Amazon Route 53 hosted zone in the future. If the VPC is already associated with the hosted zone, <code>DeleteVPCAssociationAuthorization</code> won't disassociate the VPC from the hosted zone. If you want to delete an existing association, use <code>DisassociateVPCFromHostedZone</code>.</p> </important>

    Args:
        hosted_zone_id: <p>When removing authorization to associate a VPC that was created by one Amazon Web Services account with a hosted zone that was created with a different Amazon Web Services account, the ID of the hosted zone.</p>
        vpc: <p>When removing authorization to associate a VPC that was created by one Amazon Web Services account with a hosted zone that was created with a different Amazon Web Services account, a complex type that includes the ID and region of the VPC.</p>

    Raises:
        capo_route_53.errors.concurrent_modification.ConcurrentModification: <p>Another user submitted a request to create, update, or delete the object at the same time that you did. Retry the request. </p>
        capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
        capo_route_53.errors.invalid_vpc_id.InvalidVPCId: <p>The VPC ID that you specified either isn't a valid ID or the current account is not authorized to access this VPC.</p>
        capo_route_53.errors.no_such_hosted_zone.NoSuchHostedZone: <p>No hosted zone exists with the ID that you specified.</p>
        capo_route_53.errors.vpc_association_authorization_not_found.VPCAssociationAuthorizationNotFound: <p>The VPC that you specified is not authorized to be associated with the hosted zone.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route_53.types.delete_vpc_association_authorization_request.DeleteVPCAssociationAuthorizationRequest]",
    ) -> OperationResponse[
        "capo_route_53.types.delete_vpc_association_authorization_response.DeleteVPCAssociationAuthorizationResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.delete_vpc_association_authorization

        output, http_response = (
            capo_route_53._operations.aws_dns_v20130401.delete_vpc_association_authorization.delete_vpc_association_authorization(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteVPCAssociationAuthorization")
    )
    input_: capo_route_53.types.delete_vpc_association_authorization_request.DeleteVPCAssociationAuthorizationRequest = {
        "hosted_zone_id": hosted_zone_id,
        "vpc": vpc,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output