To grant permissions to an external Amazon account, enter a command similar to the
following.
aws lakeformation grant-permissions --principal DataLakePrincipalIdentifier=111122223333 --permissions "DATA_LOCATION_ACCESS" --permissions-with-grant-option "DATA_LOCATION_ACCESS" --resource '{ "DataLocation": {"CatalogId":"123456789012","ResourceArn":"arn:aws:s3::retail/transactions/2020q1"}}'
This command grants DATA_LOCATION_ACCESS
with the grant option to
account 1111-2222-3333 on the Amazon S3 location
s3://retail/transactions/2020q1
, which is owned by account
1234-5678-9012.
To grant permissions to an organization, enter a command similar to the
following.
aws lakeformation grant-permissions --principal DataLakePrincipalIdentifier=arn:aws:organizations::111122223333:organization/o-abcdefghijkl --permissions "DATA_LOCATION_ACCESS" --permissions-with-grant-option "DATA_LOCATION_ACCESS" --resource '{"DataLocation": {"CatalogId":"123456789012","ResourceArn":"arn:aws:s3::retail/transactions/2020q1"}}'
This command grants DATA_LOCATION_ACCESS
with grant option to the
organization o-abcdefghijkl
on the Amazon S3 location
s3://retail/transactions/2020q1
, which is owned by account
1234-5678-9012.
To grant permissions to a principal in an external Amazon account, enter a command
similar to the following.
aws lakeformation grant-permissions --principal DataLakePrincipalIdentifier=arn:aws:iam::111122223333:user/datalake_user1 --permissions "DATA_LOCATION_ACCESS" --resource '{ "DataLocation": {"ResourceArn":"arn:aws:s3::retail/transactions/2020q1", "CatalogId": "123456789012"}}'
This command grants DATA_LOCATION_ACCESS
to a principal in account
1111-2222-3333 on the Amazon S3 location
s3://retail/transactions/2020q1
, which is owned by account
1234-5678-9012.
The following example grants data location permissions on
s3://retail
to ALLIAMPrincipals
group in an
external account.
aws lakeformation grant-permissions --principal DataLakePrincipalIdentifier=111122223333:IAMPrincipals --permissions "DATA_LOCATION_ACCESS" --resource '{ "DataLocation": {"ResourceArn":"arn:aws:s3:::retail", "CatalogId": "123456789012"}}'