

# Cross-account data sharing

**Time:** 1 hour

**Prerequisites:** This tutorial spans three AWS accounts, ideally in the same organization in AWS Organizations, connected through a single IAM Identity Center–based SageMaker Unified Studio domain (corporate-domain):
+ **Governance (111111111111)** – domain admin; hosts the root domain, the SageMaker Catalog, and account associations.
+ **Producer (222222222222)** – data engineering team; hosts a retail\_sales\_performance table in the SageMaker Lakehouse.
+ **Consumer (333333333333)** – data analytics team; runs analytics tools (Query Editor) that need the data.

Three people federate through IAM Identity Center and map to roles: a SageMaker Domain Administrator, a Data Engineer (producer), and a Data Analyst (consumer). Each has signed in at least once, and the SageMaker Domain Administrator is a root domain owner.

**Outcome:** The producer team publishes a retail sales table to the shared catalog. The consumer team in a different account discovers it, subscribes through a governed request, and queries it in place, with no data copied or moved.

![The domain User management tab showing SSO user access through IAM Identity Center and three assigned SSO users: data-analyst, data-engineer, and sagemaker-domain-admin.](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/images/gs-cross-account/gs-xacct-prereq.png)


## What you will do
<a name="gs-xacct-what-you-will-do"></a>

An organization's data often lives in separate accounts. The usual workaround copies data on a schedule, which produces stale duplicates and leaves no audit trail. With the business catalog, you can build a data mesh across accounts without moving or copying data.

In this tutorial, you will:
+ Associate the producer and consumer accounts with the governance domain
+ Provision each team's tools with project profiles
+ Create a producer project and set up a governance framework (metadata form and business glossary)
+ Bring data into the lakehouse and publish it as a curated, classified asset
+ Create a consumer project
+ Discover, subscribe to, and query the asset from the consumer account

## Step 1: Associate the producer and consumer accounts
<a name="gs-xacct-step1"></a>

Association is a two-way handshake: The governance account requests, and the target account accepts. This handshake extends the domain's governance into an existing account without migrating anything. For the full account association procedure, see [Associated accounts](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/adminguide/associated-accounts.html) in the Administrator Guide.

1. From the governance account, open the Amazon SageMaker console, open your Identity Center–based domain, select the **Account associations** tab, and choose **Request association**.

1. Choose **External RAM share**, select the managed permission that lets IAM users and roles access APIs and sign in to SageMaker Unified Studio, enter the producer account ID (222222222222), and choose **Request association**.

1. In the producer account, open the SageMaker console, choose **View requests**, select the domain, and choose **Accept association**.

1. On the **Enable Tooling** page, add a VPC and two subnets, leave the rest as default, and choose **Enable blueprint**.

1. Repeat the handshake for the consumer account (333333333333). The **Account associations** tab then lists all three accounts.

**Note**  
Associating an account automatically creates an admin project named admin-project-<accountID> in the domain account, which you can use to verify the association succeeded.

![The Associated domains page showing the corporate-domain domain in the Associated state with its domain ARN.](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/images/gs-cross-account/gs-xacct-associated-account.png)


**Why association matters**  
Association is the boundary-crossing primitive of the mesh. It creates the trust and provisioning path that later lets a project in one account read a table published from another, all managed centrally from the governance account.

## Step 2: Provision team tools with project profiles
<a name="gs-xacct-step2"></a>

A project profile is a template that binds capabilities (from a blueprint) to a specific account and Region and authorizes specific roles.

1. In the governance account, on the **Project profiles** tab, choose **Create**.

1. Create a profile named **All Capabilities - Data Engineering** from the **All capabilities** template, target the producer account and its Region, and authorize the SageMaker Domain Admin and Data Engineer roles.

1. From the producer account, enable all capabilities.

1. Repeat to create **All Capabilities - Data Analysts** targeting the consumer account and authorizing the Data Analyst role, then enable all capabilities from the consumer account.

![The Project profiles tab listing two enabled profiles, All Capabilities - Data Engineering and All Capabilities - Data Analysts.](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/images/gs-cross-account/gs-xacct-project-profile.png)


**Why project profiles matter**  
Project profiles standardize what a team gets without hand-building infrastructure each time. The profile decides which account a project's resources are created in, which capabilities are available, and who is allowed to use them. Producers and consumers can then share one template while landing resources in different accounts.

## Step 3: Create the producer project
<a name="gs-xacct-step3"></a>

1. Sign in as the Data Engineer and open SageMaker Unified Studio.

1. Choose **Create project**.

1. Name it **Data engineering and curation** and select the All Capabilities - Data Engineering profile. This provisions resources in the producer account.

1. Specify a lakehouse database name such as data\_engineering\_curation.

1. Review and choose **Create project**.

![The Create project review page showing the project name Data engineering and curation, the All Capabilities - Data Engineering profile, the corporate-domain domain unit, and blueprint parameters including the Lakehouse Database name data_engineering_curation_db.](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/images/gs-cross-account/gs-xacct-create-project.png)


**Note**  
Before the Data Engineer can create the project and its governance constructs, an administrator must add the Data Engineer and Data Analyst roles to the domain unit's project creation policy, and designate Owner for all projects in the glossary creation policy and the metadata form creation policy.

## Step 4: Set up a governance framework
<a name="gs-xacct-step4"></a>

You invest once in reusable governance constructs so that metadata stays consistent and searchable across the mesh.

First, create the metadata form:

1. In the Data engineering and curation project, create a metadata form named **Data Ownership** (technical name dataOwnership).

1. Add a required **Data Owner Name** string field (technical name dataOwnerName) and an optional **Data Steward Name** string field (technical name dataStewardName).

1. Enable the form.

Next, create the business glossary:

1. In the Data engineering and curation project, create a business glossary named **Data Classification**.

1. Add the following terms:
   + **Confidential**
   + **Proprietary** – internal data not intended for public access
   + **Public** – data available outside the organization and intended for public consumption
   + **Restricted** – information that requires the highest level of protection; unauthorized disclosure could have serious financial, legal, or reputational repercussions

1. Enable the glossary.

**The consumer payoff**  
When the analyst later finds the table, they immediately see its classification, owner, and steward before requesting access.

## Step 5: Bring data into the lakehouse
<a name="gs-xacct-step5"></a>

1. In the Data engineering and curation project, choose **Query Editor**, and then expand the data\_engineering\_curation database.

1. Enter and run the following CREATE TABLE statement to create a table populated with sample retail sales data.

```sql
CREATE TABLE "AwsDataCatalog"."data_engineering_curation"."retail_sales_performance"
WITH (
    format = 'PARQUET',
    parquet_compression = 'SNAPPY'
)
AS
SELECT "date", "store_id", "product_id", "sales_amount", "units_sold"
FROM (
    VALUES
        ('2024-01-01', 'STORE_001', 'PROD_101', 1500.00, 30),
        ('2024-01-01', 'STORE_002', 'PROD_102', 2300.50, 45),
        ('2024-01-02', 'STORE_001', 'PROD_103', 870.75,  18),
        ('2024-01-02', 'STORE_003', 'PROD_101', 3200.00, 64),
        ('2024-01-03', 'STORE_002', 'PROD_104', 1100.25, 22),
        ('2024-01-03', 'STORE_004', 'PROD_102', 4500.00, 90),
        ('2024-01-04', 'STORE_001', 'PROD_105', 675.50,  13),
        ('2024-01-04', 'STORE_003', 'PROD_103', 2900.00, 58),
        ('2024-01-05', 'STORE_002', 'PROD_101', 1800.00, 36),
        ('2024-01-05', 'STORE_004', 'PROD_104', 3350.75, 67)
) AS t("date", "store_id", "product_id", "sales_amount", "units_sold");
```

1. Preview the table or run a SELECT query to confirm that the data loaded.

![The Query Editor running an Athena query against the retail_sales_performance table in the data_engineering_curation database, with sample rows returned in the results pane.](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/images/gs-cross-account/gs-xacct-query.png)


## Step 6: Curate and publish the data asset
<a name="gs-xacct-step6"></a>

Curation turns a raw technical table into a governed, discoverable data product. The process is AI-first: You generate metadata automatically, then refine it.

1. In **Catalog management** > **Assets**, open the retail\_sales\_performance asset.

1. Choose **Generate Descriptions** and accept.

1. Choose **Generate Terms** and review (for example, Proprietary).

1. Add the Data Ownership metadata form and enter an owner (Jane Howard) and steward (Frank Smith).

1. Accept the automated column-level metadata.

1. Rename the asset to **Retail Sales and Performance Analytics**.

1. Choose **Publish Asset**.

**Note**  
Publishing makes the asset discoverable across the domain but does not grant access. Consumers must subscribe and be approved before they can query the data.

![The retail_sales_performance asset page marked Published, showing the business metadata summary, the Proprietary glossary term, and the owning project Data engineering and curation.](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/images/gs-cross-account/gs-xacct-published-asset.png)


**The consumer payoff**  
The technical table retail\_sales\_performance in the producer account becomes Retail Sales and Performance Analytics in the catalog—described in business language, classified, owned, and searchable across the domain—while the data itself never leaves the producer account.

## Step 7: Create the consumer project
<a name="gs-xacct-step7"></a>

1. Sign in as the Data Analyst and open SageMaker Unified Studio.

1. Choose **Create project**.

1. Name it **Data analysis** and select the All Capabilities - Data Analysts profile. This provisions resources in the consumer account.

1. Specify a lakehouse database name such as data\_analysis.

1. Review and choose **Create project**.

## Step 8: Discover, subscribe, and query
<a name="gs-xacct-step8"></a>

The consumer now works entirely from its own account.

1. As the Data Analyst, open the Data analysis project and choose **Catalog**.

1. Search for **sales** and open the Retail Sales and Performance Analytics asset.

1. Review the business and technical metadata and choose **Subscribe**, adding a reason for the request.

1. As the Data Engineer, open the producer project, go to **Catalog management** > **Subscription requests**, open the request, set access to **Full access**, and choose **Approve**.

1. As the Data Analyst, on the **Subscribed** tab, open the asset and choose **Query with Athena**. The Query Editor opens with the retail\_sales\_performance table available in the data\_analysis database, and a query returns the first rows, confirming access.

**The consumer payoff**  
The analyst queries live producer data from their own account using their own tools. When the producer's pipeline refreshes the table, the analyst sees current data on the next query, with no sync job to maintain.

## What's next
<a name="gs-xacct-next-steps"></a>
+ **Scale the mesh**: Associate more producer and consumer accounts and add project profiles.
+ **Invest in governance**: Expand your metadata forms and business glossaries before curating more tables.
+ **Start small**: Validate the end-to-end flow with a single producer and consumer pair and one published asset, then extend. Because consumers query the data in place, existing applications keep working as you extend the mesh.

## What you learned
<a name="gs-xacct-learned"></a>

In this tutorial, you:
+ Associated producer and consumer accounts with a governance domain
+ Provisioned each team's tools with project profiles
+ Created a producer project and a reusable governance framework
+ Published a curated, classified, owned data asset to the shared catalog
+ Subscribed to and queried the asset from a different account, with no data movement