In today’s data-driven landscape, organizations are seeking ways to streamline their data management processes and unlock the full potential of their data assets, while controlling access and enforcing governance. That’s why we introduced Amazon DataZone.
Amazon DataZone is a powerful data management service that empowers data engineers, data scientists, product managers, analysts, and business users to seamlessly catalog, discover, analyze, and govern data across organizational boundaries, AWS accounts, data lakes, and data warehouses.
On March 21, 2024, Amazon DataZone introduced several exciting enhancements to its Amazon Redshift integration that simplify the process of publishing and subscribing to data warehouse assets like tables and views, while enabling Amazon Redshift customers to take advantage of the data management and governance capabilities or Amazon DataZone.
These updates empower the experience for both data users and administrators.
Data producers and consumers can now quickly create data warehouse environments using preconfigured credentials and connection parameters provided by their Amazon DataZone administrators.
Additionally, these enhancements grant administrators greater control over who can access and use the resources within their AWS accounts and Redshift clusters, and for what purpose.
As an administrator, you can now create parameter sets on top of DefaultDataWarehouseBlueprint by providing parameters such as cluster, database, and an AWS secret. You can use these parameter sets to create environment profiles and authorize Amazon DataZone projects to use these environment profiles for creating environments.
In turn, data producers and data consumers can now select an environment profile to create environments without having to provide the parameters themselves, saving time and reducing the risk of issues.
In this post, we explain how you can use these enhancements to the Amazon Redshift integration to publish your Redshift tables to the Amazon DataZone data catalog, and enable users across the organization to discover and access them in a self-service fashion. We present a sample end-to-end customer workflow that covers the core functionalities of Amazon DataZone, and include a step-by-step guide of how you can implement this workflow.
The same workflow is available as video demonstration on the Amazon DataZone official YouTube channel.
Solution overview To get started with the new Amazon Redshift integration enhancements, consider the following scenario:
catalog_sales)At a high level, the steps we walk you through in the following sections include tasks for the Amazon DataZone administrator, Sales team, and Marketing team.
Prerequisites For the workflow described in this post, we assume a single AWS account, a single AWS Region, and a single AWS Identity and Access Management (IAM) user, who will act as Amazon DataZone administrator, Sales team (producer), and Marketing team (consumer).
To follow along, you need an AWS account. If you don’t have an account, you can create one.
In addition, you must have the following resources configured in your account:
If you don’t have these resources already configured, you can create them by deploying an AWS CloudFormation stack:
AdminUserPassword, enter a password, and take note of this password to use in later steps.You should be logged in using the same role that you used to deploy the CloudFormation stack and verify that you’re in the same Region.
As a final prerequisite, you need to create a catalog_sales table in the default Redshift database (dev).
catalog_sales table, which the Sales team will publish in the workflow: CREATE TABLE catalog_sales AS SELECT 146776932 AS order_number, 23 AS quantity, 23.4 AS wholesale_cost, 45.0 as list_price, 43.0 as sales_price, 2.0 as discount, 12 as ship_mode_sk,13 as warehouse_sk, 23 as item_sk, 34 as catalog_page_sk, 232 as ship_customer_sk, 4556 as bill_customer_skUNION ALL SELECT 46776931, 24, 24.4, 46, 44, 1, 14, 15, 24, 35, 222, 4551UNION ALL SELECT 46777394, 42, 43.4, 60, 50, 10, 30, 20, 27, 43, 241, 4565UNION ALL SELECT 46777831, 33, 40.4, 51, 46, 15, 16, 26, 33, 40, 234, 4563UNION ALL SELECT 46779160, 29, 26.4, 50, 61, 8, 31, 15, 36, 40, 242, 4562UNION ALL SELECT 46778595, 43, 28.4, 49, 47, 7, 28, 22, 27, 43, 224, 4555UNION ALL SELECT 46779482, 34, 33.4, 64, 44, 10, 17, 27, 43, 52, 222, 4556UNION ALL SELECT 46779650, 39, 37.4, 51, 62, 13, 31, 25, 31, 52, 224, 4551UNION ALL SELECT 46780524, 33, 40.4, 60, 53, 18, 32, 31, 31, 39, 232, 4563UNION ALL SELECT 46780634, 39, 35.4, 46, 44, 16, 33, 19, 31, 52, 242, 4557UNION ALL SELECT 46781887, 24, 30.4, 54, 62, 13, 18, 29, 24, 52, 223, 4561
Now you’re ready to get started with the new Amazon Redshift integration enhancements.
Amazon DataZone administrator tasks As the Amazon DataZone administrator, you perform the following tasks:
DefaultDataWarehouseBlueprint.DefaultDataWarehouseBlueprint by providing parameters such as cluster, database, and AWS secret.Configure the DefaultDataWarehouseBlueprint Amazon DataZone blueprints define what AWS tools and services are provisioned to be used within an Amazon DataZone environment. Enabling the data warehouse blueprint will allow data consumers and data producers to use Amazon Redshift and the Query Editor for data sharing, accessing, and consuming.
If you used the CloudFormation template, the blueprint is already enabled.
Part of the new Amazon Redshift experience involves the Managing projects and Parameter sets tabs. The Managing projects tab lists the projects that are allowed to create environment profiles using the data warehouse blueprint. By default, this is set to all projects. For our purpose, let’s grant only the admin project.
On the Managing projects tab, choose Edit.
Select Restrict to only managing projects and choose the AdminPRJ project.
With this enhancement, the administrator can control which projects can use default blueprints in their account to create environment profile
The Parameter sets tab lists parameters that you can create on top of DefaultDataWarehouseBlueprint by providing parameters such as Redshift cluster or Redshift Serverless workgroup name, database name, and the credentials that allow Amazon DataZone to connect to your cluster or workgroup. You can also create AWS secrets on the Amazon DataZone console. Before these enhancements, AWS secrets had to be managed separately using AWS Secrets Manager, making sure to include the proper tags (key-value) for Amazon Redshift Serverless.
For our scenario, we need to create a parameter set to connect a Redshift Serverless workgroup containing sales data.
us-east-1).If you already have an AWS secret with credentials to your Redshift Serverless workgroup, you can provide the existing AWS secret ARN. In this case, the secret must be tagged with the following (key-value): AmazonDataZoneDomain: <Amazon DataZone domain ID>.
Amazon DataZone creates a new secret using Secrets Manager and makes sure the secret is tagged with the domain in which you’re creating the parameter set.
sales-workgroup for the workgroup name and dev for the database name.You can see the parameter set created for your Redshift environment and the blueprint enabled with a single managing project configured.
Set up environment profiles for the Sales and Marketing teams Environment profiles are predefined templates that encapsulate technical details required to create an environment, such as the AWS account, Region, and resources and tools to be added to projects. The next Amazon DataZone administrator task consists of setting up environment profiles, based on the default enabled blueprint, for the Sales and Marketing teams.
This task will be performed from the admin project in the Amazon DataZone data portal, so let’s follow the data portal URL and start creating an environment profile for the Sales team to publish their data.
When you open the data portal for the first time, you’re prompted to create a project. If you used the provided CloudFormation template, the projects are already created.
AdminPRJ project.SalesEnvProfile) and optional description (for example, Sales DWH Environment Profile) for the new environment profile.AdminPRJ.DefaultDataWarehouse blueprint (you’ll only see blueprints where the admin project is listed as a managing project).Then you will see each pre-compiled value for Redshift Serverless. Under Authorized projects, you can pick the authorized projects allowed to use this environment profile to create an environment. By default, this is set to All projects.
SalesPRJ project.Next, you create a second environment profile for the Marketing team to consume data. To do this, you repeat similar steps made for the Sales team.
AdminPRJ project.MarketingEnvProfile) and optional description (for example, Marketing DWH Environment Profile).AdminPRJ.DefaultDataWarehouse blueprint.MarketingPRJ).With these two environment profiles in place, the Sales and Marketing teams can start working on their projects on their own to create their proper environments (resources and tools) with fewer configurations and less risk to incur errors, and publish and consume data securely and efficiently within these environments.
To recap, the new enhancements offer the following features:
AmazonDataZoneDomain tag (the AmazonDataZoneProject tag is only required if you choose to provide your own parameter sets in the environment profile).These enhancements grant administrators more control over Amazon DataZone resources and projects and facilitate the common activities of all roles involved.
Sales team tasks As a data producer, the Sales team performs the following tasks:
Create a sales environment Now that you have an environment profile, you need to create an environment in order to work with data and analytics tools in this project.
SalesPRJ project.SalesDwhEnv) and optional description (for example, Environment DWH for Sales) for the new environment.SalesEnvProfile.Data producers can now select an environment profile to create environments, without the need to provide their own Amazon Redshift parameters. The AWS secret, Region, workgroup, and database are ported over to the environment from the environment profile, streamlining and simplifying the experience for Amazon DataZone users.
The environment will be automatically provisioned by Amazon DataZone with the preconfigured credentials and connection parameters, allowing the Sales team to publish Amazon Redshift tables seamlessly.
Create a data source Now, let’s create a new data source for our sales data.
SalesPRJ project.SalesDataSource) and optional description.SalesDevEnv.public) and then specify a table selection criterion (for example, *).Here, the * indicates that this data source will bring into Amazon DataZone all the technical metadata from the database tables of your schema (in this case, a single table called catalog_sales).
On the next page, automated metadata generation is enabled. This means that Amazon DataZone will automatically generate the business names of the table and columns for that asset.
When the data source has finished running, you can see the catalog_sales asset correctly added to the inventory.
Publish sales data to the Amazon DataZone data catalog Open the catalog_sales asset to see details of the new asset (business metadata, technical metadata, and so on).
In a real-world scenario, this pre-publishing phase is when you can enrich the asset providing more business context and information, such as a readme, glossaries, or metadata forms. For example, you can start accepting some metadata automatically generated recommendations and rename the asset or its columns in order to make them more readable, descriptive, and easy to search and understand from a business user.
For this post, simply choose Publish asset to complete the Sales team tasks.
Marketing team tasks Let’s switch to the Marketing team and subscribe to the catalog_sales asset published by the Sales team. As a consumer team, the Marketing team will complete the following tasks:
Create a marketing environment To subscribe and access Amazon DataZone assets, the Marketing team needs to create an environment.
MarketingPRJ project.MarketingDwhEnv) and optional description (for example, Environment DWH for Marketing).MarketingEnvProfile.As with data producers, data consumers can also benefit from a pre-configured profile (created and managed by the administrator) in order to speed up the environment creation process, avoiding mistakes and reducing risks of errors.
Discover and subscribe to sales data Now that we have a consumer environment, let’s search the catalog_sales table in the Amazon DataZone data catalog.
sales in the search bar.catalog_sales table.When you get a subscription request as a data producer, Amazon DataZone will notify you through a task in the sales producer project. Because you’re acting as both subscriber and publisher here, you will see a notification.
You can see details including which project has requested access, who is the requestor, and why access is needed.
Now that subscription has been approved, let’s go back to the MarketingPRJ. On the Subscribed data page, catalog_sales is listed as an approved asset, but access hasn’t been granted yet. If we choose the asset, you can see that Amazon DataZone is working on the backend to automatically grant the access. When it’s complete, you’ll see the subscription as granted and the message “Asset added to 1 environment.”
Query data in Amazon Redshift Now that the marketing project has access to the sales data, we can use the Amazon Redshift Query Editor V2 to analyze the sales data.
MarketingPRJ, go to the Environments page and select the marketing environment.When you’re connected, you will see the catalog_sales table under the public schema.
SELECT * FROM catalog_sales LIMIT 10
As a consumer, you’re now able to explore data and create reports, or you can aggregate data and create new assets to publish in Amazon DataZone, becoming a producer of a new data product to share with other users and departments.
Clean up To clean up your resources, complete the following steps:
Conclusion In this post, we demonstrated how you can get started with the new Amazon Redshift integration in Amazon DataZone. We showed how to streamline the experience for data producers and consumers and how to grant administrators control over data resources.
Embrace these enhancements and unlock the full potential of Amazon DataZone and Amazon Redshift for your data management needs.
Resources For more information, refer to the following resources:
About the author Carmen is a Solutions Architect at AWS, based in Milan (Italy). She is a Data Lover that enjoys helping companies in the adoption of Cloud technologies, especially with Data Analytics and Data Governance. Outside of work, she is a creative people who loves being in contact with nature and sometimes practicing adrenaline activities.