Skip to content

delete_resource_policy async

delete_resource_policy(
    resource_arn: Arn,
    policy_id: PolicyId,
    *,
    config_overrides: Optional[AsyncSSMIncidentsClientConfig] = None,
) -> DeleteResourcePolicyOutput

Deletes the resource policy that Resource Access Manager uses to share your Incident Manager resource.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the resource you're deleting the policy from.

  • policy_id (PolicyId) –

    The ID of the resource policy you're deleting.

Raises:

Source code in docs_src/capo_ssm_incidents/_services/async_ssm_incidents.py
async def delete_resource_policy(
    self,
    resource_arn: "capo_ssm_incidents.types.arn.Arn",
    policy_id: "capo_ssm_incidents.types.policy_id.PolicyId",
    *,
    config_overrides: Optional[AsyncSSMIncidentsClientConfig] = None,
) -> "capo_ssm_incidents.types.delete_resource_policy_output.DeleteResourcePolicyOutput":
    """<p>Deletes the resource policy that Resource Access Manager uses to share your Incident Manager resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource you're deleting the policy from.</p>
        policy_id: <p>The ID of the resource policy you're deleting.</p>

    Raises:
        capo_ssm_incidents.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
        capo_ssm_incidents.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_ssm_incidents.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which doesn't exist. </p>
        capo_ssm_incidents.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_ssm_incidents.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ssm_incidents.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm_incidents.types.delete_resource_policy_input.DeleteResourcePolicyInput]",
    ) -> AsyncOperationResponse[
        "capo_ssm_incidents.types.delete_resource_policy_output.DeleteResourcePolicyOutput"
    ]:
        import capo_ssm_incidents._operations.ssm_incidents.delete_resource_policy

        (
            output,
            http_response,
        ) = await capo_ssm_incidents._operations.ssm_incidents.delete_resource_policy.async_delete_resource_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteResourcePolicy")
    )
    input_: capo_ssm_incidents.types.delete_resource_policy_input.DeleteResourcePolicyInput = {
        "resource_arn": resource_arn,
        "policy_id": policy_id,
    }

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