Permissions APIs - AWS Lake Formation

Permissions APIs

The Permissions API describes data types and operations having to do with granting and revoking permissions in AWS Lake Formation.

Data Types

Resource Structure

A structure for the resource.

Fields

  • Catalog – An empty-structure named CatalogResource.

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

  • Database – A DatabaseResource object.

    The database for the resource. Unique to the Data Catalog. A database is a set of associated table definitions organized into a logical group. You can Grant and Revoke database permissions to a principal.

  • Table – A TableResource object.

    The table for the resource. A table is a metadata definition that represents your data. You can Grant and Revoke table privileges to a principal.

  • TableWithColumns – A TableWithColumnsResource object.

    The table with columns for the resource. A principal with permissions to this resource can select metadata from the columns of a table in the Data Catalog and the underlying data in Amazon S3.

  • DataLocation – A DataLocationResource object.

    The location of an Amazon S3 path where permissions are granted or revoked.

DatabaseResource Structure

A structure for the database object.

Fields

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, it is the account ID of the caller.

  • NameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the database resource. Unique to the Data Catalog.

TableResource Structure

A structure for the table object. A table is a metadata definition that represents your data. You can Grant and Revoke table privileges to a principal.

Fields

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, it is the account ID of the caller.

  • DatabaseNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the database for the table. Unique to a Data Catalog. A database is a set of associated table definitions organized into a logical group. You can Grant and Revoke database privileges to a principal.

  • Name – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the table.

  • TableWildcard – An empty-structure named TableWildcard.

    A wildcard object representing every table under a database.

    At least one of TableResource$Name or TableResource$TableWildcard is required.

TableWithColumnsResource Structure

A structure for a table with columns object. This object is only used when granting a SELECT permission.

This object must take a value for at least one of ColumnsNames, ColumnsIndexes, or ColumnsWildcard.

Fields

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, it is the account ID of the caller.

  • DatabaseNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the database for the table with columns resource. Unique to the Data Catalog. A database is a set of associated table definitions organized into a logical group. You can Grant and Revoke database privileges to a principal.

  • NameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the table resource. A table is a metadata definition that represents your data. You can Grant and Revoke table privileges to a principal.

  • ColumnNames – An array of UTF-8 strings.

    The list of column names for the table. At least one of ColumnNames or ColumnWildcard is required.

  • ColumnWildcard – A ColumnWildcard object.

    A wildcard specified by a ColumnWildcard object. At least one of ColumnNames or ColumnWildcard is required.

DataLocationResource Structure

A structure for a data location object where permissions are granted or revoked.

Fields

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog where the location is registered with AWS Lake Formation. By default, it is the account ID of the caller.

  • ResourceArnRequired: UTF-8 string.

    The Amazon Resource Name (ARN) that uniquely identifies the data location resource.

DataLakePrincipal Structure

The AWS Lake Formation principal. Supported principals are IAM users or IAM roles.

Fields

  • DataLakePrincipalIdentifier – UTF-8 string, not less than 1 or more than 255 bytes long.

    An identifier for the AWS Lake Formation principal.

ResourcePermissions Structure

The permissions granted or revoked on a resource.

Fields

  • Resource – A Resource object.

    The resource to be granted or revoked permissions.

  • Permissions – An array of UTF-8 strings.

    The permissions to be granted or revoked on the resource.

  • PermissionsWithGrantOption – An array of UTF-8 strings.

    Indicates whether to grant the ability to grant permissions (as a subset of permissions granted).

ResourcePermissionsError Structure

A structure representing an error from granting or revoking permissions on the resource.

Fields

  • ResourcePermissions – A ResourcePermissions object.

    A list of resource permissions that had errors.

  • Error – An ErrorDetail object.

    The error associated with the attempt to grant or revoke permissions on the resource.

PrincipalResourcePermissions Structure

The permissions granted or revoked on a resource.

Fields

  • Principal – A DataLakePrincipal object.

    The Data Lake principal to be granted or revoked permissions.

  • Resource – A Resource object.

    The resource where permissions are to be granted or revoked.

  • Permissions – An array of UTF-8 strings.

    The permissions to be granted or revoked on the resource.

  • PermissionsWithGrantOption – An array of UTF-8 strings.

    Indicates whether to grant the ability to grant permissions (as a subset of permissions granted).

  • AdditionalDetails – A DetailsMap object.

    This attribute can be used to return any additional details of PrincipalResourcePermissions. Currently returns only as a RAM resource share ARN.

DetailsMap Structure

A structure containing the additional details to be returned in the AdditionalDetails attribute of PrincipalResourcePermissions.

If a catalog resource is shared through AWS Resource Access Manager (AWS RAM), then there will exist a corresponding RAM resource share ARN.

Fields

  • ResourceShare – An array of UTF-8 strings.

    A resource share ARN for a catalog resource shared through AWS Resource Access Manager (AWS RAM).

PrincipalResourcePermissionsError Structure

A structure representing an error in granting or revoking permissions to the principal.

Fields

  • PrincipalResourcePermissions – A PrincipalResourcePermissions object.

    The principal permissions that were to be granted or revoked.

  • Error – An ErrorDetail object.

    The error message for the attempt to grant or revoke permissions.

ColumnWildcard Structure

A wildcard object, consisting of an optional list of excluded column names or indexes.

Fields

  • ExcludedColumnNames – An array of UTF-8 strings.

    Excludes column names. Any column with this name will be excluded.

BatchPermissionsRequestEntry Structure

A permission to a resource granted by batch operation to the principal.

Fields

  • IdRequired: UTF-8 string, not less than 1 or more than 255 bytes long.

    A unique identifier for the batch permissions request entry.

  • Principal – A DataLakePrincipal object.

    The principal to be granted a permission.

  • Resource – A Resource object.

    The resource to which the principal is to be granted a permission.

  • Permissions – An array of UTF-8 strings.

    The permissions to be granted.

  • PermissionsWithGrantOption – An array of UTF-8 strings.

    Indicates if the option to pass permissions is granted.

BatchPermissionsFailureEntry Structure

A list of failures when performing a batch grant or batch revoke operation.

Fields

  • RequestEntry – A BatchPermissionsRequestEntry object.

    An identifier for an entry of the batch request.

  • Error – An ErrorDetail object.

    An error message that applies to the failure of the entry.

PrincipalPermissions Structure

Permissions granted to a principal.

Fields

  • Principal – A DataLakePrincipal object.

    The principal who is granted permissions.

  • Permissions – An array of UTF-8 strings.

    The permissions that are granted to the principal.

Operations

GrantPermissions Action (Python: grant_permissions)

Grants permissions to the principal to access metadata in the Data Catalog and data organized in underlying data storage such as Amazon S3.

For information about permissions, see Security and Access Control to Metadata and Data.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

  • PrincipalRequired: A DataLakePrincipal object.

    The principal to be granted the permissions on the resource. Supported principals are IAM users or IAM roles, and they are defined by their principal type and their ARN.

    Note that if you define a resource with a particular ARN, then later delete, and recreate a resource with that same ARN, the resource maintains the permissions already granted.

  • ResourceRequired: A Resource object.

    The resource to which permissions are to be granted. Resources in AWS Lake Formation are the Data Catalog, databases, and tables.

  • PermissionsRequired: An array of UTF-8 strings.

    The permissions granted to the principal on the resource. AWS Lake Formation defines privileges to grant and revoke access to metadata in the Data Catalog and data organized in underlying data storage such as Amazon S3. AWS Lake Formation requires that each principal be authorized to perform a specific task on AWS Lake Formation resources.

  • PermissionsWithGrantOption – An array of UTF-8 strings.

    Indicates a list of the granted permissions that the principal may pass to other users. These permissions may only be a subset of the permissions granted in the Privileges.

Response

  • No Response parameters.

Errors

  • ConcurrentModificationException

  • EntityNotFoundException

  • InvalidInputException

RevokePermissions Action (Python: revoke_permissions)

Revokes permissions to the principal to access metadata in the Data Catalog and data organized in underlying data storage such as Amazon S3.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

  • PrincipalRequired: A DataLakePrincipal object.

    The principal to be revoked permissions on the resource.

  • ResourceRequired: A Resource object.

    The resource to which permissions are to be revoked.

  • PermissionsRequired: An array of UTF-8 strings.

    The permissions revoked to the principal on the resource. For information about permissions, see Security and Access Control to Metadata and Data.

  • PermissionsWithGrantOption – An array of UTF-8 strings.

    Indicates a list of permissions for which to revoke the grant option allowing the principal to pass permissions to other principals.

Response

  • No Response parameters.

Errors

  • ConcurrentModificationException

  • EntityNotFoundException

  • InvalidInputException

BatchGrantPermissions Action (Python: batch_grant_permissions)

Batch operation to grant permissions to the principal.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

  • EntriesRequired: An array of BatchPermissionsRequestEntry objects.

    A list of up to 20 entries for resource permissions to be granted by batch operation to the principal.

Response

Errors

  • InvalidInputException

  • OperationTimeoutException

BatchRevokePermissions Action (Python: batch_revoke_permissions)

Batch operation to revoke permissions from the principal.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

  • EntriesRequired: An array of BatchPermissionsRequestEntry objects.

    A list of up to 20 entries for resource permissions to be revoked by batch operation to the principal.

Response

Errors

  • InvalidInputException

  • OperationTimeoutException

GetEffectivePermissionsForPath Action (Python: get_effective_permissions_for_path)

Returns the Lake Formation permissions for a specified table or database resource located at a path in Amazon S3. GetEffectivePermissionsForPath will not return databases and tables if the catalog is encrypted.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

  • ResourceArnRequired: UTF-8 string.

    The Amazon Resource Name (ARN) of the resource for which you want to get permissions.

  • NextToken – UTF-8 string.

    A continuation token, if this is not the first call to retrieve this list.

  • MaxResults – Number (integer), not less than 1 or more than 1000.

    The maximum number of results to return.

Response

  • Permissions – An array of PrincipalResourcePermissions objects.

    A list of the permissions for the specified table or database resource located at the path in Amazon S3.

  • NextToken – UTF-8 string.

    A continuation token, if this is not the first call to retrieve this list.

Errors

  • InvalidInputException

  • EntityNotFoundException

  • OperationTimeoutException

  • InternalServiceException

ListPermissions Action (Python: list_permissions)

Returns a list of the principal permissions on the resource, filtered by the permissions of the caller. For example, if you are granted an ALTER permission, you are able to see only the principal permissions for ALTER.

This operation returns only those permissions that have been explicitly granted.

For information about permissions, see Security and Access Control to Metadata and Data.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

  • Principal – A DataLakePrincipal object.

    Specifies a principal to filter the permissions returned.

  • ResourceType – UTF-8 string (valid values: CATALOG | DATABASE | TABLE | DATA_LOCATION).

    Specifies a resource type to filter the permissions returned.

  • Resource – A Resource object.

    A resource where you will get a list of the principal permissions.

    This operation does not support getting privileges on a table with columns. Instead, call this operation on the table, and the operation returns the table and the table w columns.

  • NextToken – UTF-8 string.

    A continuation token, if this is not the first call to retrieve this list.

  • MaxResults – Number (integer), not less than 1 or more than 1000.

    The maximum number of results to return.

Response

  • PrincipalResourcePermissions – An array of PrincipalResourcePermissions objects.

    A list of principals and their permissions on the resource for the specified principal and resource types.

  • NextToken – UTF-8 string.

    A continuation token, if this is not the first call to retrieve this list.

Errors

  • InvalidInputException

  • OperationTimeoutException

  • InternalServiceException