14.7 C
Canberra
Monday, October 20, 2025

Configure seamless single sign-on with SQL analytics in Amazon SageMaker Unified Studio


Amazon SageMaker Unified Studio supplies a unified expertise for utilizing knowledge, analytics, and AI capabilities. SageMaker Unified Studio now helps trusted identification propagation (TIP) for SQL workloads, enabling fine-grained knowledge entry management primarily based on particular person consumer identities. Organizations can use this integration to handle knowledge permissions by way of AWS Lake Formation whereas utilizing their current single sign-on (SSO) infrastructure.

Organizations already utilizing Amazon Redshift with TIP can prolong their current Lake Formation permissions to SageMaker Unified Studio. Customers merely log in by way of SSO and entry their licensed knowledge utilizing the SQL editor, sustaining constant safety controls throughout their analytics atmosphere.

This publish demonstrates the right way to configure SageMaker Unified Studio with SSO, arrange tasks and consumer onboarding, and entry knowledge securely utilizing built-in analytics instruments.

Resolution overview

For our use case, a retail company is planning to implement gross sales analytics to establish gross sales patterns and product classes which are doing nicely. It will assist the gross sales staff enhance on gross sales planning with focused promotions and assist the finance staff plan budgeting with higher stock administration. The company shops a buyer desk in an Amazon Easy Storage Service (Amazon S3) knowledge lake and a store_sales desk in a Redshift cluster.

The company makes use of SageMaker Unified Studio because the UI, with customers onboarded from their identification supplier (IdP) to AWS IAM Id Heart with TIP. Amazon SageMaker Lakehouse centralizes knowledge from Amazon S3 and Amazon Redshift, and Lake Formation supplies fine-grained entry management primarily based on consumer identification. For our instance use case, we discover two completely different customers. The next desk summarizes their roles, the instruments they use, and their knowledge entry.

Consumer Group Software Information Entry
Ethan (Information Analyst) Gross sales Amazon Athena for interactive SQL evaluation Non-sensitive buyer knowledge (id, c_country, birth_year) and store_sales full desk entry
Frank (BI Analyst) Finance Amazon Redshift for experiences and visualization US buyer knowledge (c_country='US')

The next diagram illustrates the answer structure.

SageMaker Unified Studio with IAM Id Heart simplifies the consumer journey from authentication to knowledge evaluation. The workflow consists of the next steps:

  1. Customers register with organizational SSO credentials by way of their IdP and are redirected to SageMaker Unified Studio.
  2. Customers configure IAM Id Heart authentication for Amazon Redshift, linking identification administration with knowledge entry.
  3. Customers entry the question editor for Amazon Redshift or SageMaker Lakehouse, triggering IAM Id Heart federation to generate session and entry tokens.
  4. SageMaker Unified Studio retrieves consumer authorization particulars and group membership utilizing the session token.
  5. Customers are authenticated as IAM Id Heart customers, able to discover and analyze knowledge utilizing Amazon Redshift and Amazon Athena.

To implement our answer, we stroll by way of the next high-level steps:

  1. Arrange SageMaker Lakehouse assets.
  2. Create a SageMaker Unified Studio area with SSO and TIP enabled.
  3. Configure Amazon Redshift for TIP and validate entry.
  4. Validate knowledge entry utilizing Amazon Athena.

Stipulations

Earlier than you start implementing the answer, you could have the next in place:

  1. In case you don’t have an AWS account, you possibly can enroll for one.
  2. We offer utility scripts to assist arrange numerous sections of the publish. To make use of them:
    1. Proper-click this hyperlink and save the utility scripts zip file.
    2. Unzip the file to a terminal that has the AWS Command Line Interface (AWS CLI) configured. You can even use AWS CloudShell.
    3. Run the scripts solely when prompted within the related sections.

    Notice: The utility scripts are configured for
    us-east-1 area. In case you favor one other area, edit the area within the scripts earlier than operating them.

  3. To deploy the infrastructure, right-click this hyperlink and choose ‘Save Hyperlink As’ to put it aside as sagemaker-unified-studio-infrastructure.yaml. Then add the file when creating a brand new stack within the AWS CloudFormation console, which is able to create the next assets:
    1. An S3 bucket to carry the client knowledge used on this publish.
    2. An AWS Id and Entry Administration (IAM) position known as DataTransferRole with permissions as outlined in Stipulations for managing Amazon Redshift namespaces within the AWS Glue Information Catalog.
    3. An IAM position known as IAMIDCRedshiftRole, which shall be used later to arrange the IAM Id Heart Redshift software.
    4. An IAM position known as LakeFormationRegistrationRole, following the directions in Necessities for roles used to register areas, and vital IAM insurance policies.
  4. In case you don’t have a Lake Formation consumer, you possibly can create one. For this publish, we use an admin consumer. For directions, see Create an information lake administrator.
  5. If IAM Id Heart shouldn’t be enabled, discuss with Enabling AWS IAM Id Heart for directions to allow it.
    1. If you must migrate current Redshift customers and teams, use the IAM Id Heart Redshift migration utility.
    2. For a fast approach to take a look at the characteristic and familiarize your self with the method, we offer a script to generate mock customers and teams. Run the setup-idc.sh script, which is offered in Step 2, to create take a look at customers and teams in IAM Id Heart for demonstration functions.
  6. Combine IAM Id Heart with Lake Formation. For directions, see Connecting Lake Formation with IAM Id Heart.
  7. Register the S3 bucket as an information lake location:
    1. On the Lake Formation console, select Information lake areas within the navigation pane.
    2. Select Register location.
    3. For the position, use LakeFormationRegistrationRole.
  8. Create an IAM Id Heart Redshift software, as detailed in our earlier publish:
    1. On the Amazon Redshift console, select IAM Id Heart connections within the navigation pane and select Create software.
    2. For each the show identify and software identify, enter redshift-idc-app.
    3. Set the IdP namespace to awsidc.
    4. Select IAMIDCRedshiftRole because the IAM position.
    5. Select Subsequent to create the appliance.
    6. Pay attention to the appliance Amazon Useful resource Identify (ARN) to make use of in subsequent steps. The ARN format is arn:aws:sso:::software/ssoins-/apl-.
  9. In case you don’t have current Redshift tables to work with, run the script setup-producer-redshift.sh, which is offered in Step 2, to create a producer namespace and workgroup, arrange a pattern gross sales database, and generate vital tables with take a look at knowledge.
  10. The publish additionally makes use of simulated buyer knowledge saved within the AWS Glue Information Catalog. To arrange this knowledge and configure the mandatory Lake Formation permissions, run the setup-glue-tables-and-access.sh script offered in Step 2.

Arrange SageMaker Lakehouse assets

On this part, we configure the foundational lakehouse assets required for SageMaker to entry and analyze knowledge throughout a number of storage techniques. We’ll register the Redshift occasion to the AWS Glue Information Catalog to make warehouse knowledge discoverable and set up Lake Formation permissions on lakehouse assets for consumer identities to make sure safe, ruled entry to each knowledge lake and knowledge warehouse assets from inside SageMaker environments.

Register Redshift occasion to the Information Catalog

On this step, we use the store_sales knowledge, which we created earlier utilizing the setup-producer-redshift.sh script. You’ll be able to register whole clusters to the Information Catalog and create catalogs managed by AWS Glue. To register a cluster to the Information Catalog, full the next steps:

  1. On the Lake Formation console, select Administrative roles and duties within the navigation pane.
  2. Below Information lake directors, select Add.
  3. Select Learn-only administrator, then select AWSServiceRoleForRedshift.
  4. On the Amazon Redshift console, open your namespace.
  5. On the Actions dropdown menu, selected Register with AWS Glue Information Catalog, then select Register.
  6. Sign up to the Lake Formation console as the information lake administrator and select Catalogs within the navigation pane.
  7. Below Pending catalog invites, choose the namespace and settle for the invitation by selecting Approve and create catalog.
  8. Present the identify for the catalog as salescatalog.
  9. Choose Entry this catalog from Apache Iceberg suitable engines, select DataTransferRole for the IAM position, then select Subsequent.
  10. Select Add permissions and select the admin IAM position underneath IAM customers and roles.
  11. Choose Tremendous consumer for catalog permissions and select Add.
  12. Select Subsequent.
  13. Select Create catalog.

Arrange Lake Formation permission on lakehouse assets for consumer identities

On this part, we configure Lake Formation permissions to allow safe entry to lakehouse assets for federated consumer identities. Lake Formation supplies fine-grained entry management that works seamlessly with IAM Id Heart, permitting you to handle permissions centrally whereas sustaining safety boundaries.

We’ll deal with granting database entry to IAM Id Heart teams in Lake Formation and setting table-level permissions for federated Redshift catalog tables. These permissions kind the safety basis for our federated question structure, enabling customers to seamlessly entry each S3 knowledge lake and Redshift knowledge warehouse assets by way of a unified interface.

Grant database entry to IAM Id Heart teams in Lake Formation

After you share your Redshift catalog with the Information Catalog and combine with Lake Formation, you could grant acceptable database entry. Observe these steps to arrange permissions in your knowledge lake assets for company identities:

  1. On the Lake Formation console, underneath Permissions within the navigation pane, select Information permissions.
  2. Select Grant.
  3. Choose Principals for Principal sort.
  4. Below Principals, choose IAM Id Heart and select Add.
  5. Within the pop-up window, if that is your first time assigning customers and teams, select Get began.
  6. Seek for and choose the IAM Id Heart teams awssso-sales and awssso-finance.
  7. Select Assign.
  8. Below LF-Tags or catalog assets, select Named Information Catalog assets.
    1. Select :salescatalog/dev for Catalogs.
    2. Select sales_schema for Database.
  9. Below Database permissions, choose Describe.
  10. Select Grant to use the permissions.

Grant table-level permissions for federated Redshift catalog tables

Full the next steps to grant desk permissions to the IAM Id Heart teams:

  1. On the Lake Formation console, underneath Permissions within the navigation pane, select Information permissions.
  2. Select Grant.
  3. Choose Principals for Principal sort.
  4. Below Principals, choose IAM Id Heart and select Add.
  5. Within the pop-up window, if that is your first time assigning customers and teams, select Get began.
  6. Seek for and choose the IAM Id Heart group awssso-sales.
  7. Select Assign.
  8. Below LF-Tags or catalog assets, select Named Information Catalog assets.
    1. Select :salescatalog/dev for Catalogs.
    2. Select sales_schema for Database.
    3. Select store_sales for Desk.
  9. Choose Choose and Describe for Desk permissions.
  10. Select Grant to use the permissions.

Create a SageMaker Unified Studio area with SSO and TIP enabled

For directions to create a SageMaker Unified Studio area, discuss with Create an Amazon SageMaker Unified Studio area – fast setup. As a result of your IAM Id Heart integration is already full, you possibly can specify an IAM Id Heart consumer within the area configuration settings.

Allow TIP in SageMaker Unified Studio

Full the next steps to allow TIP in SageMaker Unified Studio:

  1. On the SageMaker console, use the AWS Area selector within the high navigation bar to decide on the suitable Area.
  2. Select View domains and select the area’s identify from the checklist.
  3. On the area’s particulars web page, on the Challenge profiles tab, select a venture profile, for instance, SQL analytics.
  4. Choose SQL analytics and select Edit.
  5. Within the Blueprint parameters part, choose enableTrustedIdentityPropagationPermissions and select Edit.
  6. Replace the worth as true.
  7. To implement authorization-based on TIP, the SageMaker Unified Studio admin could make this parameter non-editable.
  8. Select Save.

Allow consumer entry for SageMaker Unified Studio area

Full the next steps to allow consumer entry for the SageMaker Unified Studio area:

  1. Open the SageMaker console within the acceptable Area and select Domains within the navigation pane.
  2. Select an current SageMaker Unified Studio area the place you need to add SSO consumer entry.
  3. On the area’s particulars web page, on the Consumer administration tab, within the Customers part, select Add and Add SSO customers and teams.
  4. Select the consumer (for this publish, we add the consumer Frank) from the dropdown checklist and select Add customers and teams.

Add venture members

SageMaker Unified Studio tasks facilitate staff collaboration for various enterprise initiatives. Because the venture proprietor, Ethan now can add Frank as a staff member to allow their collaboration. So as to add members to an current venture, full the next steps:

  1. Sign up to the SageMaker Unified Studio console utilizing the SSO credentials of who owns the venture (for this publish, Ethan).
  2. Select Choose a venture.
  3. Select the venture you need to edit.
  4. On the Challenge overview web page, develop Actions and select Handle members.
  5. Select Add members.
  6. Enter the identify of the consumer or group you need to add (for this publish, we add Frank).
  7. Choose Contributor if you wish to add the venture member as a contributor.
  8. (Optionally available) Repeat these steps so as to add extra venture members. You’ll be able to add as much as eight venture members at a time.
  9. Select Add members.

Create a SQL analytics venture in Unified Studio

On this step, we federate into SageMaker Unified Studio and create a venture utilizing SQL analytics. Full the next steps:

  1. Federate into SageMaker Unified Studio utilizing your IAM Id Heart credentials:
    1. On the SageMaker console, select Domains within the navigation pane.
    2. Copy the SageMaker Unified Studio URL in your area and enter it into a brand new browser window.
    3. Select Sign up with SSO.
    4. A browser pop-up will redirect you to your most popular IdP login web page, the place you enter your IdP credentials.
    5. If authentication if profitable, you may be redirected to SageMaker Unified Studio.
  2. After logging in, select Create venture.
  3. Enter a reputation in your venture. This venture identify is last and may’t be modified later.
  4. (Optionally available) Enter an outline in your venture. You’ll be able to edit this later.
  5. Select a venture profile. For this demo, we select the SQL analytics profile from the obtainable templates.
  6. Depart the default values as they’re or modify them based on your use case, then select Proceed.
  7. Select Create venture to finalize the venture and initialize your SQL analytics workspace.

For extra detailed info and superior configurations, discuss with Create a venture.

Configure Amazon Redshift for TIP and validate entry

Run the setup-consumer-redshift.sh script (offered within the stipulations). This script will create a brand new namespace and workgroup and add the required tags, which you’ll use later to combine with SageMaker Unified Studio compute.

If you’re creating the cluster manually, add one of many following tags to the Redshift cluster or workgroup that you just need to add to SageMaker Unified Studio:

  • Possibility 1 – Add a tag to permit solely a particular SageMaker Unified Studio venture to entry it: AmazonDataZoneProject=
  • Possibility 2 – Add a tag to permit all SageMaker Unified Studio tasks on this account to entry it: for-use-with-all-datazone-projects=true

Create compute utilizing IAM Id Heart authentication

After you arrange your venture, the subsequent step is to determine a compute useful resource connection on the SageMaker Unified Studio console. Observe these steps so as to add both Amazon Redshift Serverless or a provisioned cluster to your venture atmosphere:

  1. Go to the Compute part of your venture in SageMaker Unified Studio.
  2. On the Information warehouse tab, select Add compute.
  3. You’ll be able to create a brand new compute useful resource or select an current one. For this publish, we select Hook up with current compute assets, then select Subsequent.
  4. Select the kind of compute useful resource you need to add, then select Subsequent. For this publish, we select Redshift Serverless.
  5. Below Connection properties, present the JDBC URL or the compute you need to add, which is built-in with IAM Id Heart. If the compute useful resource is in the identical account as your SageMaker Unified Studio venture, you possibly can choose the compute useful resource from the dropdown menu. In our instance, we use the patron account that was simply provisioned.
  6. Below Authentication, choose IAM Id Heart.
  7. For Identify, enter the identify of the Redshift Serverless or provisioned cluster you need to add.
  8. For Description, enter an outline of the compute useful resource.
  9. Select Add compute.

The SageMaker Unified Studio Challenge Compute and Information pages will now show info for that useful resource.

If every little thing is configured accurately, your compute shall be created utilizing IAM Id Heart. As a result of your IdP credentials are already cached whilst you’re logged in to SageMaker Unified Studio, it makes use of the identical credentials and creates the compute.

Take a look at knowledge entry utilizing Amazon Redshift

When Ethan logs in to SageMaker Unified Studio utilizing IAM Id Heart authentication, he efficiently federates and may entry buyer knowledge from all international locations however just for non-sensitive columns. Let’s connect with Amazon Redshift in SageMaker Unified Studio by following these steps:

  1. Select Actions and select Open Question editor.
  2. Select Redshift within the Information explorer pane.
  3. Run the client gross sales calculation question to watch that consumer Ethan (an information analyst) can entry buyer knowledge from all international locations however solely non-sensitive columns (id, birth_country, product_id):
    choose current_user, c.*, sum(s.sales_amount) as total_sales
    from "awsdatacatalog"."customerdb"."buyer" c
    be a part of "dev@salescatalog"."sales_schema"."store_sales" s 
    on c.id=s.id
    group by all;

You might have efficiently configured Redshift to make use of IAM Id Heart authentication in SageMaker Unified Studio.

Validate knowledge entry utilizing Amazon Athena

When Frank logs in to SageMaker Unified Studio utilizing IAM Id Heart authentication, he efficiently federates and may entry buyer knowledge just for the US. To question with Athena, full the next steps:

  1. Select Actions and select Open Question editor.
  2. Select Lakehouse within the Information explorer pane.
  3. Discover AwsDataCatalog, develop the database, select the respective desk, and on the choices menu (three dots), select Preview knowledge.

The next demonstration illustrates how consumer Frank, a BI analyst, can carry out SQL evaluation utilizing Athena. Resulting from row-level filtering applied by way of Lake Formation, Frank’s entry is restricted to buyer knowledge from the US solely. Moreover, you possibly can observe that within the Information explorer pane, Frank can solely view the customerdb database. The dev@salescatalog database shouldn’t be seen to Frank as a result of no entry has been granted to his respective group from Lake Formation.

The IAM Id Heart authentication integration is full; you need to use each Amazon Redshift and Athena by way of SageMaker Unified Studio in a simplified, all-in-one interface.Notice that, on the time of writing, Athena doesn’t work with Redshift Managed Storage (RMS).

Clear up

Full the next steps to scrub up the assets you created as a part of this publish:

  1. Delete the information from the S3 bucket.
  2. Delete the Information Catalog objects.
  3. Delete the Lake Formation assets and Athena account.
  4. Delete the SageMaker Unified Studio venture and related area.
  5. In case you created new Redshift cluster for testing this answer, delete the cluster.

Conclusion

On this publish, we offered a complete information to enabling trusted identification propagation inside SageMaker Unified Studio. We lined the setup of a SageMaker Unified Studio area with SSO, the creation of tailor-made tasks, environment friendly consumer onboarding with acceptable permissions, and the administration of AWS Glue and Amazon Redshift managed catalog permissions utilizing Lake Formation. By way of sensible examples, we demonstrated the right way to use each Amazon Redshift and Athena inside SageMaker Unified Studio, showcasing safe knowledge entry and evaluation capabilities. This method helps organizations keep strict identification controls whereas serving to knowledge scientists and analysts derive helpful insights from each knowledge lake and knowledge warehouse environments, supporting each safety and productiveness in machine studying workflows.

For extra info on this integration, discuss with Trusted identification propagation.


Concerning the authors

Maneesh Sharma

Maneesh Sharma

Maneesh is a Sr. Architect at AWS with 15 years of expertise designing and implementing large-scale knowledge warehouse and analytics options. He works intently with clients to assist them modernize their legacy purposes to AWS cloud-based platforms.

Srividya Parthasarathy

Srividya Parthasarathy

Srividya is a Senior Massive Information Architect with Amazon SageMaker Lakehouse. She works with the product staff and clients to construct strong options and options for his or her analytical knowledge platform. She enjoys constructing knowledge mesh options and sharing them with the group.

Arun A K

Arun A Ok

Arun is a Senior Massive Information Specialist Options Architect at Amazon Internet Companies. He helps clients design and scale knowledge platforms that energy innovation by way of analytics and AI. Arun is enthusiastic about exploring how knowledge and rising applied sciences can clear up real-world issues. Exterior of labor, he enjoys sharing information with the tech group and spending time together with his household.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles