Common Terminologies in Guidewire You Should Know
AWS Glue Catalog provides a centralized metadata repository for managing data across different AWS accounts. In enterprise environments, teams often need secure, cross-account access to share metadata, tables, and schemas efficiently. This guide walks through the process of configuring cross-account access for AWS Glue Catalog.
Understanding Cross-Account Access in AWS Glue
By default, AWS Glue Catalog is account-specific, but you can grant access to other accounts using AWS Identity and Access Management (IAM) roles and policies. The key components involved are:
Source Account: The AWS account that owns the Glue Catalog.
Target Account: The AWS account that requires access to the Glue Catalog.
IAM Roles & Policies: Define permissions for secure access between accounts.
Lake Formation: Provides fine-grained access control for Glue Catalog resources.
Step 1: Creating an IAM Role for the Target Account
In the Source Account, create an IAM role that allows the Target Account to access AWS Glue.
Go to IAM → Roles → Create Role
Select AWS service and choose Glue as the use case.
Choose Another AWS Account and enter the Target Account ID.
Attach the following trust policy:
json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<TARGET_ACCOUNT_ID>:root"
},
"Action": "sts:AssumeRole"
}
]
}
Click Create Role and note the ARN for later use.
Step 2: Setting Up Glue Catalog Permissions
In the Source Account, attach a policy to the IAM role to allow Glue access:
json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"glue:GetTable",
"glue:GetDatabase",
"glue:GetTables",
"glue:GetPartitions"
],
"Resource": [
"arn:aws:glue::<SOURCE_ACCOUNT_ID>:catalog",
"arn:aws:glue::<SOURCE_ACCOUNT_ID>:database/default",
"arn:aws:glue::<SOURCE_ACCOUNT_ID>:table/default/*"
]
}
]
}
This grants the target account permission to query and retrieve metadata from the Glue Catalog.
Step 3: Configuring AWS Lake Formation for Fine-Grained Access
If AWS Lake Formation is enabled, configure Lake Formation permissions for better control:
Navigate to AWS Lake Formation → Data Permissions.
Select the Glue database and grant permissions to the Target Account IAM role.
Specify actions such as SELECT, DESCRIBE, and CREATE_TABLE.
Lake Formation ensures secure, governed access to shared metadata across accounts.
Step 4: Testing Cross-Account Access
In the Target Account, assume the IAM role and retrieve Glue metadata:
python
import boto3
session = boto3.Session(profile_name="cross_account_role")
glue_client = session.client("glue")
response = glue_client.get_databases()
print(response)
If properly configured, this script will return Glue Catalog metadata from the source account.
Final Thoughts
Setting up cross-account access for AWS Glue Catalog improves data sharing and governance across multiple AWS accounts. By using IAM roles, policies, and Lake Formation, organizations can enable secure metadata access while maintaining strict security controls.
Need help integrating AWS Glue with data lakes or analytics platforms? Let’s explore further!
Learn : GuideWire Certification Course Training
Read More : Guidewire Architecture Explained for Beginners
Visit IHUB Talent Institute Hyderabad
Get Direction
Comments
Post a Comment