Skip to content

list_rls_policy_attachments

list_rls_policy_attachments(
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    resource: Optional[Resource] = None,
    principal: Optional[DataLakePrincipal] = None,
    policy_name: Optional[NameString] = None,
    max_results: Optional[PageSize] = None,
    next_token: Optional[Token] = None,
) -> ListRLSPolicyAttachmentsResponse

Lists the row-level security policy attachments in the Data Catalog. You can filter the results by resource, principal, or policy name.

Parameters:

  • resource (Optional[Resource], default: None ) –

    If specified, returns only the attachments for the given resource.

  • principal (Optional[DataLakePrincipal], default: None ) –

    If specified, returns only the attachments for the given principal.

  • policy_name (Optional[NameString], default: None ) –

    If specified, returns only the attachments for the row-level security policy with this name.

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

    The maximum number of attachments to return in a single response.

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

    A continuation token, if this is a continuation call.

Raises:

Source code in docs_src/capo_lakeformation/_services/lake_formation.py
def list_rls_policy_attachments(
    self,
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    resource: Optional["capo_lakeformation.types.resource.Resource"] = None,
    principal: Optional[
        "capo_lakeformation.types.data_lake_principal.DataLakePrincipal"
    ] = None,
    policy_name: Optional["capo_lakeformation.types.name_string.NameString"] = None,
    max_results: Optional["capo_lakeformation.types.page_size.PageSize"] = None,
    next_token: Optional["capo_lakeformation.types.token.Token"] = None,
) -> "capo_lakeformation.types.list_rls_policy_attachments_response.ListRLSPolicyAttachmentsResponse":
    """<p>Lists the row-level security policy attachments in the Data Catalog. You can filter the results by resource, principal, or policy name.</p>

    Args:
        resource: <p>If specified, returns only the attachments for the given resource.</p>
        principal: <p>If specified, returns only the attachments for the given principal.</p>
        policy_name: <p>If specified, returns only the attachments for the row-level security policy with this name.</p>
        max_results: <p>The maximum number of attachments to return in a single response.</p>
        next_token: <p>A continuation token, if this is a continuation call.</p>

    Raises:
        capo_lakeformation.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_lakeformation.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist.</p>
        capo_lakeformation.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_lakeformation.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_lakeformation.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lakeformation.types.list_rls_policy_attachments_request.ListRLSPolicyAttachmentsRequest]",
    ) -> OperationResponse[
        "capo_lakeformation.types.list_rls_policy_attachments_response.ListRLSPolicyAttachmentsResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.list_rls_policy_attachments

        output, http_response = (
            capo_lakeformation._operations.aws_lake_formation.list_rls_policy_attachments.list_rls_policy_attachments(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRLSPolicyAttachments")
    )
    input_: capo_lakeformation.types.list_rls_policy_attachments_request.ListRLSPolicyAttachmentsRequest = {}
    if resource is not None:
        input_["resource"] = resource
    if principal is not None:
        input_["principal"] = principal
    if policy_name is not None:
        input_["policy_name"] = policy_name
    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