Viewing All Cross-Account Grants Using the GetResourcePolicies API Operation - AWS Lake Formation

Viewing All Cross-Account Grants Using the GetResourcePolicies API Operation

If your enterprise grants cross-account permissions using both an AWS Glue Data Catalog resource policy and Lake Formation grants, the only way to view all cross-account grants in one place is to use the glue:GetResourcePolicies API operation.

When you grant Lake Formation permissions across accounts, AWS Resource Access Manager (AWS RAM) creates an AWS Identity and Access Management (IAM) resource policy and stores it in your AWS account. The policy grants the permissions required to access the resource. AWS RAM creates a separate resource policy for each cross-account grant. You can view all of these policies by using the glue:GetResourcePolicies API operation.

Note

This operation also returns the Data Catalog resource policy. However, if you enabled metadata encryption in Data Catalog settings, and you don't have permission on the AWS KMS key, the operation won't return the Data Catalog resource policy.

To view all cross-account grants

  • Enter the following AWS CLI command.

    aws glue get-resource-policies

The following is an example resource policy that AWS RAM creates and stores when you grant permissions on table t in database db1 to AWS account 1111-2222-3333.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "glue:GetTable", "glue:GetTableVersion", "glue:GetTableVersions", "glue:GetPartition", "glue:GetPartitions", "glue:BatchGetPartition", "glue:GetTables", "glue:SearchTables" ], "Principal": {"AWS": [ "111122223333" ]}, "Resource": [ "arn:aws:glue:<region>:111122223333:table/db1/t" ] } ] }
See Also: