5.9 C
Tuesday, February 13, 2024

Automate AWS Clear Rooms querying and dashboard publishing utilizing AWS Step Features and Amazon QuickSight – Half 2

Public well being organizations want entry to knowledge insights that they’ll shortly act upon, particularly in instances of well being emergencies, when knowledge must be up to date a number of instances each day. For instance, throughout the COVID-19 pandemic, entry to well timed knowledge insights was critically vital for public well being companies worldwide as they coordinated emergency response efforts. Up-to-date data and evaluation empowered organizations to watch the quickly altering scenario and direct assets accordingly.

That is the second submit on this sequence; we advocate that you simply learn this primary submit earlier than diving deep into this answer. In our first submit, Allow knowledge collaboration amongst public well being companies with AWS Clear Rooms – Half 1 , we confirmed how public well being companies can create AWS Clear Room collaborations, invite different stakeholders to hitch the collaboration, and run queries on their collective knowledge with out both social gathering having to share or copy underlying knowledge with one another. As talked about within the earlier weblog, AWS Clear Rooms allows a number of organizations to research their knowledge and unlock insights they’ll act upon, with out having to share delicate, restricted, or proprietary information.

Nonetheless, public well being organizations leaders and decision-making officers don’t instantly entry knowledge collaboration outputs from their Amazon Easy Storage Service (Amazon S3) buckets. As a substitute, they depend on up-to-date dashboards that assist them visualize knowledge insights to make knowledgeable selections shortly.

To make sure these dashboards showcase probably the most up to date insights, the group builders and knowledge architects have to catalog and replace AWS Clear Rooms collaboration outputs on an ongoing foundation, which regularly entails repetitive and handbook processes that, if not carried out properly, may delay your group’s entry to the most recent knowledge insights.

Manually dealing with repetitive each day duties at scale poses dangers like delayed insights, miscataloged outputs, or damaged dashboards. At a big quantity, it will require around-the-clock staffing, straining budgets. This handbook strategy may expose decision-makers to inaccurate or outdated data.

Automating repetitive workflows, validation checks, and programmatic dashboard refreshes removes human bottlenecks and assist lower inaccuracies. Automation helps guarantee steady, dependable processes that ship probably the most present knowledge insights to leaders with out delays, all whereas streamlining assets.

On this submit, we clarify an automatic workflow utilizing AWS Step Features and Amazon QuickSight to assist organizations entry probably the most present outcomes and analyses, with out delays from handbook knowledge dealing with steps. This workflow implementation will empower decision-makers with real-time visibility into the evolving collaborative evaluation outputs, making certain they’ve up-to-date, related insights that they’ll act upon shortly

Answer overview

The next reference structure illustrates a number of the foundational parts of fresh rooms question automation and publishing dashboards utilizing AWS providers. We automate working queries utilizing Step Features with Amazon EventBridge schedules, construct an AWS Glue Information Catalog on question outputs, and publish dashboards utilizing QuickSight in order that they routinely refresh with new knowledge. This enables public well being groups to watch the newest insights with out handbook updates.

The structure consists of the next parts, as numbered within the previous determine:

  1. A scheduled occasion rule on EventBridge triggers a Step Features workflow.
  2. The Step Features workflow initiates the run of a question utilizing the StartProtectedQuery AWS Clear Rooms API. The submitted question runs securely throughout the AWS Clear Rooms surroundings, making certain knowledge privateness and compliance. The outcomes of the question are then saved in a delegated S3 bucket, with a novel protected question ID serving because the prefix for the saved knowledge. This distinctive identifier is generated by AWS Clear Rooms for every question run, sustaining clear segregation of outcomes.
  3. When the AWS Clear Rooms question is efficiently full, the Step Features workflow calls the AWS Glue API to replace the situation of the desk within the AWS Glue Information Catalog with the Amazon S3 location the place the question outcomes had been uploaded in Step 2.
  4. Amazon Athena makes use of the catalog from the Information Catalog to question the knowledge utilizing commonplace SQL.
  5. QuickSight is used to question, construct visualizations, and publish dashboards utilizing the info from the question outcomes.


For this walkthrough, you want the next:

Launch the CloudFormation stack

On this submit, we offer a CloudFormation template to create the next assets:

  • An EventBridge rule that triggers the Step Features state machine on a schedule
  • An AWS Glue database and a catalog desk
  • An Athena workgroup
  • Three S3 buckets:
    • For AWS Clear Rooms to add the outcomes of question runs
    • For Athena to add the outcomes for the queries
    • For storing entry logs of different buckets
  • A Step Features workflow designed to run the AWS Clear Rooms question, add the outcomes to an S3 bucket, and replace the desk location with the S3 path within the AWS Glue Information Catalog
  • An AWS Key Administration Service (AWS KMS) customer-managed key to encrypt the info in S3 buckets
  • AWS Id and Entry Administration (IAM) roles and insurance policies with the mandatory permissions

To create the mandatory assets, full the next steps:

  1. Select Launch Stack:

Launch Button

  1. Enter cleanrooms-query-automation-blog for Stack identify.
  2. Enter the membership ID from the AWS Clear Rooms collaboration you created in Half 1 of this sequence.
  3. Select Subsequent.

  1. Select Subsequent once more.
  2. On the Assessment web page, choose I acknowledge that AWS CloudFormation would possibly create IAM assets.
  3. Select Create stack.

After you run the CloudFormation template and create the assets, yow will discover the next data on the stack Outputs tab on the AWS CloudFormation console:

  • AthenaWorkGroup – The Athena workgroup
  • EventBridgeRule – The EventBridge rule triggering the Step Features state machine
  • GlueDatabase – The AWS Glue database
  • GlueTable – The AWS Glue desk storing metadata for AWS Clear Rooms question outcomes
  • S3Bucket – The S3 bucket the place AWS Clear Rooms uploads question outcomes
  • StepFunctionsStateMachine – The Step Features state machine

Take a look at the answer

The EventBridge rule named cleanrooms_query_execution_Stepfunctions_trigger is scheduled to set off each 1 hour. When this rule is triggered, it initiates the run of the CleanRoomsBlogStateMachine-XXXXXXX Step Features state machine. Full the next steps to check the end-to-end stream of this answer:

  1. On the Step Features console, navigate to the state machine you created.
  2. On the state machine particulars web page, find the most recent question run.

The small print web page lists the finished steps:

  • The state machine submits a question to AWS Clear Rooms utilizing the startProtectedQuery API. The output of the API consists of the question run ID and its standing.
  • The state machine waits for 30 seconds earlier than checking the standing of the question run.
  • After 30 seconds, the state machine checks the question standing utilizing the getProtectedQuery API. When the standing modifications to SUCCESS, it proceeds to the following step to retrieve the AWS Glue desk metadata data. The output of this step incorporates the S3 location to which the question run outcomes are uploaded.
  • The state machine retrieves the metadata of the AWS Glue desk named patientimmunization, which was created through the CloudFormation stack.
  • The state machine updates the S3 location (the situation to which AWS Clear Rooms uploaded the outcomes) within the metadata of the AWS Glue desk.
  • After a profitable replace of the AWS Glue desk metadata, the state machine is full.
  1. On the Athena console, swap the workgroup to CustomWorkgroup.
  2. Run the next question:
“SELECT * FROM "cleanrooms_patientdb "."patientimmunization" restrict 10;"

Visualize the info with QuickSight

Now that you may question your knowledge in Athena, you need to use QuickSight to visualise the outcomes. Let’s begin by granting QuickSight entry to the S3 bucket the place your AWS Clear Rooms question outcomes are saved.

Grant QuickSight entry to Athena and your S3 bucket

First, grant QuickSight entry to the S3 bucket:

  1. Sign up to the QuickSight console.
  2. Select your person identify, then select Handle QuickSight.
  3. Select Safety and permissions.
  4. For QuickSight entry to AWS providers, select Handle.
  5. For Amazon S3, select Choose S3 buckets, and select the S3 bucket named cleanrooms-query-execution-results -XX-XXXX-XXXXXXXXXXXX (XXXXX represents the AWS Area and account quantity the place the answer is deployed).
  6. Select Save.

Create your datasets and publish visuals

Earlier than you possibly can analyze and visualize the info in QuickSight, you have to create datasets to your Athena tables.

  1. On the QuickSight console, select Datasets within the navigation pane.
  2. Select New dataset.
  3. Choose Athena.
  4. Enter a reputation to your dataset.
  5. Select Create knowledge supply.
  6. Select the AWS Glue database cleanrooms_patientdb and choose the desk PatientImmunization.
  7. Choose Instantly question your knowledge.
  8. Select Visualize.

  1. On the Evaluation tab, select the visible sort of your alternative and add visuals.

Clear up

Full the next steps to scrub up your assets if you now not want this answer:

  1. Manually delete the S3 buckets and the info saved within the bucket.
  2. Delete the CloudFormation templates.
  3. Delete the QuickSight evaluation.
  4. Delete the info supply.


On this submit, we demonstrated methods to automate working AWS Clear Rooms queries utilizing an API name from Step Features. We additionally confirmed methods to replace the question outcomes data on the prevailing AWS Glue desk, question the knowledge utilizing Athena, and create visuals utilizing QuickSight.

The automated workflow answer delivers real-time insights from AWS Clear Rooms collaborations to resolution makers by automated checks for brand spanking new outputs, processing, and Amazon QuickSight dashboard refreshes. This eliminates handbook dealing with duties, enabling quicker data-driven selections based mostly on newest analyses. Moreover, automation frees up workers assets to deal with extra strategic initiatives quite than repetitive updates.

Contact the general public sector crew on to be taught extra about methods to arrange this answer, or attain out to your AWS account crew to interact on a proof of idea of this answer to your group.

About AWS Clear Rooms

AWS Clear Rooms helps corporations and their companions extra simply and securely analyze and collaborate on their collective datasets—with out sharing or copying each other’s underlying knowledge. With AWS Clear Rooms, you possibly can create a safe knowledge clear room in minutes, and collaborate with every other firm on the AWS Cloud to generate distinctive insights about promoting campaigns, funding selections, and analysis and improvement.

The AWS Clear Rooms crew is regularly constructing new options that will help you collaborate. Watch this video to be taught extra about privacy-enhanced collaboration with AWS Clear Rooms.

Try extra AWS Companions or contact an AWS Consultant to understand how we may also help speed up your corporation.

Extra assets

Concerning the Authors

Venkata Kampana is a Senior Options Architect within the AWS Well being and Human Providers crew and relies in Sacramento, CA. In that position, he helps public sector clients obtain their mission aims with well-architected options on AWS.

Jim Daniel is the Public Well being lead at Amazon Internet Providers. Beforehand, he held positions with the US Division of Well being and Human Providers for almost a decade, together with Director of Public Well being Innovation and Public Well being Coordinator. Earlier than his authorities service, Jim served because the Chief Info Officer for the Massachusetts Division of Public Well being.

Latest news
Related news


Please enter your comment!
Please enter your name here