- Newest
- Most votes
- Most comments
Hello Orlando,
Based on the information provided, it seems that the issue you're facing could be related to resource-based policies in AWS Glue Data Catalog.
AWS Glue supports resource-based policies that can be attached to individual databases and tables in the Data Catalog. These resource policies can further restrict access to specific resources, even if the IAM policy allows access.
In addition to the IAM policy you've configured, you need to ensure that the resource-based policies attached to the databases and tables you're trying to access allow the necessary permissions.
Resource-based policies in AWS Glue Data Catalog are JSON policy documents that specify the principal (IAM user, role, or account) and the actions they are allowed or denied to perform on the resource (database or table). These policies are attached directly to the resource and are evaluated in addition to the IAM policies.
To validate if resource-based policies are causing the issue, you can follow these steps:
-
Use the AWS CLI or AWS Glue Console to list the databases and tables in the Data Catalog.
-
For each database or table you're trying to access, use the
get-resource-policycommand in the AWS CLI or the AWS Glue Console to retrieve the resource-based policy attached to that resource. -
Review the resource-based policy and ensure that it allows the necessary permissions for the IAM user or role you're using. The policy should include a statement that grants the
glue:GetDatabase,glue:GetTables,glue:GetTable,glue:GetPartitions, andglue:GetPartitionactions to the IAM user or role. -
If the resource-based policy does not allow the necessary permissions, you'll need to update the policy or create a new policy that grants the required permissions.
-
Use the
put-resource-policycommand in the AWS CLI or the AWS Glue Console to attach the updated or new resource-based policy to the database or table.
Additionally, the documentation mentions that AWS Glue also supports service-linked roles, which are predefined IAM roles that grant AWS Glue the necessary permissions to access other AWS services on your behalf. If you're using AWS Glue Crawlers or other AWS Glue features that interact with other AWS services, you might need to ensure that the service-linked role has the necessary permissions to access the Data Catalog resources.
By reviewing and updating the resource-based policies and ensuring that the service-linked roles have the necessary permissions, you should be able to resolve the issue and allow the IAM user to read tables from the existing Data Catalog.
AWS Documentation references : https://docs.aws.amazon.com/glue/latest/dg/security_iam_service-with-iam.html?icmpid=docs_console_unmapped#security_iam_service-with-iam-resource-based-policies https://docs.aws.amazon.com/glue/latest/dg/security_iam_resource-based-policy-examples.html
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
