Skip to content

get_temporary_glue_table_credentials

get_temporary_glue_table_credentials(
    table_arn: ResourceArnString,
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    permissions: Optional[PermissionList] = None,
    duration_seconds: Optional[CredentialTimeoutDurationSecondInteger] = None,
    audit_context: Optional[AuditContext] = None,
    supported_permission_types: Optional[PermissionTypeList] = None,
    s3_path: Optional[PathString] = None,
    query_session_context: Optional[QuerySessionContext] = None,
) -> GetTemporaryGlueTableCredentialsResponse

Allows a caller in a secure environment to assume a role with permission to access Amazon S3. In order to vend such credentials, Lake Formation assumes the role associated with a registered location, for example an Amazon S3 bucket, with a scope down policy which restricts the access to a single prefix.

To call this API, the role that the service assumes must have lakeformation:GetDataAccess permission on the resource.

Parameters:

  • table_arn (ResourceArnString) –

    The ARN identifying a table in the Data Catalog for the temporary credentials request.

  • permissions (Optional[PermissionList], default: None ) –

    Filters the request based on the user having been granted a list of specified permissions on the requested resource(s).

  • duration_seconds (Optional[CredentialTimeoutDurationSecondInteger], default: None ) –

    The time period, between 900 and 21,600 seconds, for the timeout of the temporary credentials.

  • audit_context (Optional[AuditContext], default: None ) –

    A structure representing context to access a resource (column names, query ID, etc).

  • supported_permission_types (Optional[PermissionTypeList], default: None ) –

    A list of supported permission types for the table. Valid values are COLUMN_PERMISSION and CELL_FILTER_PERMISSION.

  • s3_path (Optional[PathString], default: None ) –

    The Amazon S3 path for the table.

  • query_session_context (Optional[QuerySessionContext], default: None ) –

    A structure used as a protocol between query engines and Lake Formation or Glue. Contains both a Lake Formation generated authorization identifier and information from the request's authorization context.

Raises:

Source code in docs_src/capo_lakeformation/_services/lake_formation.py
def get_temporary_glue_table_credentials(
    self,
    table_arn: "capo_lakeformation.types.resource_arn_string.ResourceArnString",
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    permissions: Optional[
        "capo_lakeformation.types.permission_list.PermissionList"
    ] = None,
    duration_seconds: Optional[
        "capo_lakeformation.types.credential_timeout_duration_second_integer.CredentialTimeoutDurationSecondInteger"
    ] = None,
    audit_context: Optional[
        "capo_lakeformation.types.audit_context.AuditContext"
    ] = None,
    supported_permission_types: Optional[
        "capo_lakeformation.types.permission_type_list.PermissionTypeList"
    ] = None,
    s3_path: Optional["capo_lakeformation.types.path_string.PathString"] = None,
    query_session_context: Optional[
        "capo_lakeformation.types.query_session_context.QuerySessionContext"
    ] = None,
) -> "capo_lakeformation.types.get_temporary_glue_table_credentials_response.GetTemporaryGlueTableCredentialsResponse":
    """<p>Allows a caller in a secure environment to assume a role with permission to access Amazon S3. In order to vend such credentials, Lake Formation assumes the role associated with a registered location, for example an Amazon S3 bucket, with a scope down policy which restricts the access to a single prefix.</p> <p>To call this API, the role that the service assumes must have <code>lakeformation:GetDataAccess</code> permission on the resource.</p>

    Args:
        table_arn: <p>The ARN identifying a table in the Data Catalog for the temporary credentials request.</p>
        permissions: <p>Filters the request based on the user having been granted a list of specified permissions on the requested resource(s).</p>
        duration_seconds: <p>The time period, between 900 and 21,600 seconds, for the timeout of the temporary credentials.</p>
        audit_context: <p>A structure representing context to access a resource (column names, query ID, etc).</p>
        supported_permission_types: <p>A list of supported permission types for the table. Valid values are <code>COLUMN_PERMISSION</code> and <code>CELL_FILTER_PERMISSION</code>.</p>
        s3_path: <p>The Amazon S3 path for the table.</p>
        query_session_context: <p>A structure used as a protocol between query engines and Lake Formation or Glue. Contains both a Lake Formation generated authorization identifier and information from the request's authorization context.</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.permission_type_mismatch_exception.PermissionTypeMismatchException: <p>The engine does not support filtering data based on the enforced permissions. For example, if you call the <code>GetTemporaryGlueTableCredentials</code> operation with <code>SupportedPermissionType</code> equal to <code>ColumnPermission</code>, but cell-level permissions exist on the table, this exception is thrown.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lakeformation.types.get_temporary_glue_table_credentials_request.GetTemporaryGlueTableCredentialsRequest]",
    ) -> OperationResponse[
        "capo_lakeformation.types.get_temporary_glue_table_credentials_response.GetTemporaryGlueTableCredentialsResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.get_temporary_glue_table_credentials

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTemporaryGlueTableCredentials")
    )
    input_: capo_lakeformation.types.get_temporary_glue_table_credentials_request.GetTemporaryGlueTableCredentialsRequest = {
        "table_arn": table_arn
    }
    if permissions is not None:
        input_["permissions"] = permissions
    if duration_seconds is not None:
        input_["duration_seconds"] = duration_seconds
    if audit_context is not None:
        input_["audit_context"] = audit_context
    if supported_permission_types is not None:
        input_["supported_permission_types"] = supported_permission_types
    if s3_path is not None:
        input_["s3_path"] = s3_path
    if query_session_context is not None:
        input_["query_session_context"] = query_session_context

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