Skip to content

get_resource_policies

get_resource_policies(
    resource_arn: Arn,
    *,
    config_overrides: Optional[SSMIncidentsClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> GetResourcePoliciesOutput

Retrieves the resource policies attached to the specified response plan.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the response plan with the attached resource policy.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of resource policies to display for each page of results.

  • next_token (Optional[NextToken], default: None ) –

    The pagination token for the next set of items to return. (You received this token from a previous call.)

Raises:

Source code in docs_src/capo_ssm_incidents/_services/ssm_incidents.py
def get_resource_policies(
    self,
    resource_arn: "capo_ssm_incidents.types.arn.Arn",
    *,
    config_overrides: Optional[SSMIncidentsClientConfig] = None,
    max_results: Optional["capo_ssm_incidents.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_ssm_incidents.types.next_token.NextToken"] = None,
) -> "capo_ssm_incidents.types.get_resource_policies_output.GetResourcePoliciesOutput":
    """<p>Retrieves the resource policies attached to the specified response plan.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the response plan with the attached resource policy. </p>
        max_results: <p>The maximum number of resource policies to display for each page of results.</p>
        next_token: <p>The pagination token for the next set of items to return. (You received this token from a previous call.)</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.
    """

    def _handler(
        req: "OperationRequest[capo_ssm_incidents.types.get_resource_policies_input.GetResourcePoliciesInput]",
    ) -> OperationResponse[
        "capo_ssm_incidents.types.get_resource_policies_output.GetResourcePoliciesOutput"
    ]:
        import capo_ssm_incidents._operations.ssm_incidents.get_resource_policies

        output, http_response = (
            capo_ssm_incidents._operations.ssm_incidents.get_resource_policies.get_resource_policies(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetResourcePolicies")
    )
    input_: capo_ssm_incidents.types.get_resource_policies_input.GetResourcePoliciesInput = {
        "resource_arn": resource_arn
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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