LakeFormation / Client / get_temporary_data_location_credentials

get_temporary_data_location_credentials

LakeFormation.Client.get_temporary_data_location_credentials(**kwargs)

Allows a user or application in a secure environment to access data in a specific Amazon S3 location registered with Lake Formation by providing temporary scoped credentials that are limited to the requested data location and the caller’s authorized access level.

The API operation returns an error in the following scenarios:

  • The data location is not registered with Lake Formation.

  • No Glue table is associated with the data location.

  • The caller doesn’t have required permissions on the associated table. The caller must have SELECT or SUPER permissions on the associated table, and credential vending for full table access must be enabled in the data lake settings. For more information, see Application integration for full table access.

  • The data location is in a different Amazon Web Services Region. Lake Formation doesn’t support cross-Region access when vending credentials for a data location. Lake Formation only supports Amazon S3 paths registered within the same Region as the API call.

See also: AWS API Documentation

Request Syntax

response = client.get_temporary_data_location_credentials(
    DurationSeconds=123,
    AuditContext={
        'AdditionalAuditContext': 'string'
    },
    DataLocations=[
        'string',
    ],
    CredentialsScope='READ'|'READWRITE'
)
Parameters:
  • DurationSeconds (integer) – The time period, between 900 and 43,200 seconds, for the timeout of the temporary credentials.

  • AuditContext (dict) –

    A structure used to include auditing information on the privileged API.

    • AdditionalAuditContext (string) –

      The filter engine can populate the ‘AdditionalAuditContext’ information with the request ID for you to track. This information will be displayed in CloudTrail log in your account.

  • DataLocations (list) –

    The Amazon S3 data location that you want to access.

    • (string) –

  • CredentialsScope (string) –

    The credential scope is determined by the caller’s Lake Formation permission on the associated table. Credential scope can be either:

    • READ - Provides read-only access to the data location.

    • READ_WRITE - Provides both read and write access to the data location.

Return type:

dict

Returns:

Response Syntax

{
    'Credentials': {
        'AccessKeyId': 'string',
        'SecretAccessKey': 'string',
        'SessionToken': 'string',
        'Expiration': datetime(2015, 1, 1)
    },
    'AccessibleDataLocations': [
        'string',
    ],
    'CredentialsScope': 'READ'|'READWRITE'
}

Response Structure

  • (dict) –

    • Credentials (dict) –

      A temporary set of credentials for an Lake Formation user. These credentials are scoped down to only access the raw data sources that the user has access to.

      The temporary security credentials consist of an access key and a session token. The access key consists of an access key ID and a secret key. When the credentials are created, they are associated with an IAM access control policy that limits what the user can do when using the credentials.

      • AccessKeyId (string) –

        The access key ID for the temporary credentials.

      • SecretAccessKey (string) –

        The secret key for the temporary credentials.

      • SessionToken (string) –

        The session token for the temporary credentials.

      • Expiration (datetime) –

        The date and time when the temporary credentials expire.

    • AccessibleDataLocations (list) –

      Refers to the Amazon S3 locations that can be accessed through the GetTemporaryCredentialsForLocation API operation.

      • (string) –

    • CredentialsScope (string) –

      The credential scope is determined by the caller’s Lake Formation permission on the associated table. Credential scope can be either:

      • READ - Provides read-only access to the data location.

      • READ_WRITE - Provides both read and write access to the data location.

Exceptions

  • LakeFormation.Client.exceptions.InvalidInputException

  • LakeFormation.Client.exceptions.InternalServiceException

  • LakeFormation.Client.exceptions.OperationTimeoutException

  • LakeFormation.Client.exceptions.GlueEncryptionException

  • LakeFormation.Client.exceptions.EntityNotFoundException

  • LakeFormation.Client.exceptions.AccessDeniedException

  • LakeFormation.Client.exceptions.ConflictException