Skip to content

describe_resource_policies async

describe_resource_policies(
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    next_token: Optional[NextToken] = None,
    limit: Optional[DescribeLimit] = None,
    resource_arn: Optional[Arn] = None,
    policy_scope: Optional[PolicyScope] = None,
) -> DescribeResourcePoliciesResponse

Lists the resource policies in this account.

Parameters:

  • limit (Optional[DescribeLimit], default: None ) –

    The maximum number of resource policies to be displayed with one call of this API.

  • resource_arn (Optional[Arn], default: None ) –

    The ARN of the CloudWatch Logs resource for which to query the resource policy.

  • policy_scope (Optional[PolicyScope], default: None ) –

    Specifies the scope of the resource policy. Valid values are ACCOUNT or RESOURCE. When not specified, defaults to ACCOUNT.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def describe_resource_policies(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    next_token: Optional["capo_cloudwatch_logs.types.next_token.NextToken"] = None,
    limit: Optional[
        "capo_cloudwatch_logs.types.describe_limit.DescribeLimit"
    ] = None,
    resource_arn: Optional["capo_cloudwatch_logs.types.arn.Arn"] = None,
    policy_scope: Optional[
        "capo_cloudwatch_logs.types.policy_scope.PolicyScope"
    ] = None,
) -> "capo_cloudwatch_logs.types.describe_resource_policies_response.DescribeResourcePoliciesResponse":
    """<p>Lists the resource policies in this account.</p>

    Args:
        limit: <p>The maximum number of resource policies to be displayed with one call of this API.</p>
        resource_arn: <p>The ARN of the CloudWatch Logs resource for which to query the resource policy.</p>
        policy_scope: <p>Specifies the scope of the resource policy. Valid values are <code>ACCOUNT</code> or <code>RESOURCE</code>. When not specified, defaults to <code>ACCOUNT</code>.</p>

    Raises:
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.describe_resource_policies_request.DescribeResourcePoliciesRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.describe_resource_policies_response.DescribeResourcePoliciesResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.describe_resource_policies

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.describe_resource_policies.async_describe_resource_policies(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeResourcePolicies")
    )
    input_: capo_cloudwatch_logs.types.describe_resource_policies_request.DescribeResourcePoliciesRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn
    if policy_scope is not None:
        input_["policy_scope"] = policy_scope

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