Skip to content

analyze_access

analyze_access(
    principal: DataLakePrincipal,
    resource: Resource,
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    groups: Optional[AnalyzeAccessGroupList] = None,
    context_attributes: Optional[ContextAttributesList] = None,
) -> AnalyzeAccessResponse

Returns the effective access of a principal on a resource, and the Lake Formation permissions and row-level security policies that contributed to it.

Parameters:

  • principal (DataLakePrincipal) –

    The principal whose access to analyze.

  • groups (Optional[AnalyzeAccessGroupList], default: None ) –

    For an IAM Identity Center principal, the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that its session uses. Only one role is supported.

  • context_attributes (Optional[ContextAttributesList], default: None ) –

    Attributes that override the principal's attributes for the analysis. You can specify up to 50 attributes. If you don't specify any, the analysis uses the principal's existing attributes.

  • resource (Resource) –

    The resource on which to analyze access.

Raises:

Source code in docs_src/capo_lakeformation/_services/lake_formation.py
def analyze_access(
    self,
    principal: "capo_lakeformation.types.data_lake_principal.DataLakePrincipal",
    resource: "capo_lakeformation.types.resource.Resource",
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    groups: Optional[
        "capo_lakeformation.types.analyze_access_group_list.AnalyzeAccessGroupList"
    ] = None,
    context_attributes: Optional[
        "capo_lakeformation.types.context_attributes_list.ContextAttributesList"
    ] = None,
) -> "capo_lakeformation.types.analyze_access_response.AnalyzeAccessResponse":
    """<p>Returns the effective access of a principal on a resource, and the Lake Formation permissions and row-level security policies that contributed to it.</p>

    Args:
        principal: <p>The principal whose access to analyze.</p>
        groups: <p>For an IAM Identity Center principal, the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that its session uses. Only one role is supported.</p>
        context_attributes: <p>Attributes that override the principal's attributes for the analysis. You can specify up to 50 attributes. If you don't specify any, the analysis uses the principal's existing attributes.</p>
        resource: <p>The resource on which to analyze access.</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.federation_source_exception.FederationSourceException: <p>A generic exception encapsulating exceptions from the federation source that are not actionable by query engines.</p>
        capo_lakeformation.errors.federation_source_retryable_exception.FederationSourceRetryableException: <p>The federation source failed. This failure might be temporary. Retry the request.</p>
        capo_lakeformation.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</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.analyze_access_request.AnalyzeAccessRequest]",
    ) -> OperationResponse[
        "capo_lakeformation.types.analyze_access_response.AnalyzeAccessResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.analyze_access

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AnalyzeAccess")
    )
    input_: capo_lakeformation.types.analyze_access_request.AnalyzeAccessRequest = {
        "principal": principal,
        "resource": resource,
    }
    if groups is not None:
        input_["groups"] = groups
    if context_attributes is not None:
        input_["context_attributes"] = context_attributes

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