The DataMeshAdmin.py
class provides functions to create the Data Mesh, and to enable AWS Accounts to act as Producers and Consumers.
DataMeshAdmin(
data_mesh_account_id: str,
region_name: str = 'us-east-1',
log_level: str = "INFO",
use_credentials=None
)
data_mesh_account_id
: The AWS Account ID to use as the central Data Mesh Account in the regionregion_name
: The short AWS Region Name in which to install the Data Meshlog_level
: The level of information you want to see when executing. Based upon pythonlogging
, values includeINFO
,DEBUG
,ERROR
, etc.use_credentials
: Credentials to use to setup the instance. This can be provided as a boto3 Credentials object, a dict containing the below structure, or if None is provided the boto3 environment will be accessed.
{
"AccountId": "The Consumer AWS Account ID",
"AccessKeyId": "Your access key",
"SecretAccessKey": "Your secret key",
"SessionToken": "Optional - a session token, if you are using an IAM Role & temporary credentials"
}
The following methods are available:
initialize_mesh_account
initialize_producer_account
initialize_consumer_account
enable_account_as_producer
enable_account_as_consumer
Sets up an AWS Account to act as the central governance account in an AWS Region.
initialize_mesh_account()
None
dict
{
"Manager": str
"ReadOnly": str
"SubscriptionTracker": {
"Table": str,
"Stream": str,
}
}
Manager
: ARN of theDataMeshManager
IAM Role created for subsequent administration tasksReadOnly
: ARN of theDataMeshReadOnly
IAM Role used to view public metadataSubscriptionTracker
: dictTable
: The ARN of the DynamoDB Table used to track subscriptions over timeStream
: The ARN of the DynamoDB Stream you can subscribe to for event processing
Installs the required IAM security objects into an AWS Account so that it can act as a Producer.
initialize_producer_account(
crawler_role_arn: str = None
)
crawler_role_arn
: The ARN of an IAM Role to be used for Glue Crawlers by the Producer. This ARN will be enabled for iam:PassRole by the Producer principal.
None
Installs the required IAM security objects into an AWS Account so that it can act as a Consumer.
initialize_consumer_account()
None
None
Within the Data Mesh Account, enables an Account to publish data products and grant permissions using Lake Formation.
enable_account_as_producer(
account_id: str,
enable_crawler_role: str = None
):
account_id
: The AWS Account to allow to act as a Producerenable_crawler_role
: The role ARN from the Producer Account which will be updating data mesh objects.
None
Within the Data Mesh Account, enables an Account to request subscriptions to data products and accept sharing invitations.
enable_account_as_consumer(
account_id: str
):
account_id
: The AWS Account to allow to act as a Producer
None