-1.1 C
New York
Thursday, February 5, 2026

Speed up knowledge governance with customized subscription workflows in Amazon SageMaker


Amazon SageMaker gives a single knowledge and AI growth surroundings to find and construct along with your knowledge. This unified platform integrates performance from present AWS Analytics and Synthetic Intelligence and Machine Studying (AI/ML) providers, together with Amazon EMR, AWS Glue, Amazon Athena, Amazon Redshift, and Amazon Bedrock.

Organizations have to effectively handle knowledge belongings whereas sustaining governance controls of their knowledge marketplaces. Though guide approval workflows stay essential for delicate datasets and manufacturing programs, there’s an growing want for automated approval processes with much less delicate datasets. On this put up, we present you the way to automate subscription request approvals inside SageMaker, accelerating knowledge entry for knowledge customers.

Stipulations

For this walkthrough, you have to have the next stipulations:

  • An AWS account – Should you don’t have an account, you possibly can create one. The account ought to have permission to do the next:
    • Create and handle SageMaker domains
    • Create and handle IAM roles
    • Create and invoke Lambda features
  • SageMaker area – For directions to create a site, check with Create an Amazon SageMaker Unified Studio area – fast setup.
  • A demo venture – Create a demo venture in your SageMaker area. For directions, see Create a venture. For this instance, we select All capabilities within the venture profile part.
  • SageMaker area ID, venture ID, and venture position ARN – These will probably be utilized in later steps to supply permissions for present datasets and assets, and automated subscription approval code. To retrieve this info, go to the Mission particulars tab on the venture particulars web page on the SageMaker console.
  • AWS CLI put in – It’s essential to have the AWS Command Line Interface (AWS CLI) model 2.11 or later.
  • Python put in – It’s essential to have Python model 3.8 or later.
  • IAM permissions – Check in because the person with administrative entry
  • Lambda permissions – Configure the suitable IAM permissions for the Lambda execution position. The next code is a pattern position used for testing this resolution. Earlier than implementing this IAM coverage in your surroundings, present the values to your particular AWS Area and account ID. Alter them primarily based on the precept of least privilege. To study extra about creating Lambda execution roles, check with Defining Lambda operate permissions with an execution position.
    {
        "Model": "2012-10-17",
        "Assertion": [
            {
                "Effect": "Allow",
                "Action": [
                    "datazone:ListSubscriptionRequests",
                    "datazone:AcceptSubscriptionRequest",
                    "datazone:GetSubscriptionRequestDetails",
                    "datazone:GetDomain",
                    "datazone:ListProjects"
                ],
                "Useful resource": "<>"
            },
            {
                "Impact": "Permit",
                "Motion": "sts:AssumeRole",
                "Useful resource": "<>",
                "Situation": {
                    "StringEquals": {
                        "aws:PrincipalArn": "<>"
                    }
                }
            },
            {
                "Impact": "Permit",
                "Motion": "sns:Publish",
                "Useful resource": "<>"
            },
            {
                "Impact": "Permit",
                "Motion": [
                    "logs:CreateLogGroup",
                    "logs:CreateLogStream",
                    "logs:PutLogEvents"
                ],
                "Useful resource": [
                    "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*",
                    "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*:*"
                ]
            }
        ]
    }

Answer overview

Understanding the subscription and approval workflow in Amazon SageMaker is essential earlier than diving deep into customized workflow resolution. After an asset is printed to the SageMaker catalog, knowledge customers can uncover belongings. When an information shopper discovers belongings in SageMaker catalog, they request entry to the asset, by submitting a subscription request with enterprise justification and meant use case. The request enters a pending state and notifies the information producer or asset proprietor for assessment. The information producer evaluates the request primarily based on governance insurance policies, shopper credentials, and enterprise context. The information producer can settle for, reject, or request further info from the information shopper. Upon acceptance, SageMaker triggers the AcceptSubscriptionRequest occasion and begins automated entry provisioning. After a subscription is accepted, a subscription fulfilment course of will get kicked off to facilitate entry to the asset, for the information producer. SageMaker integrates deeply with AWS Lake Formation to handle fine-grained permissions. When a subscription is permitted, SageMaker mechanically calls Lake Formation APIs to grant particular database, desk, and column-level permissions to the subscriber’s IAM position. Lake Formation acts because the central permission engine, translating subscription approvals into precise knowledge entry rights with out guide intervention. The system provisions and updates resource-based insurance policies on knowledge sources. As soon as the provisioning completes, the information shopper can instantly entry subscribed knowledge by way of question engines like Athena, Redshift, or EMR, with Lake Formation imposing permissions at question time.

By default, subscription requests to a printed asset require guide approval by an information proprietor. Nevertheless, Amazon SageMaker helps automated approval of subscription requests at asset degree: when publishing an information asset, you possibly can select to not require subscription approval. On this case, all incoming subscription requests to that asset are mechanically permitted. Let’s first define the step-by-step course of for disabling automated approval on the asset degree.

Configure automated approval at asset degree:

To configure automated approval, knowledge producers can observe the steps beneath.

  1. Log in to SageMaker Unified Studio portal as knowledge producer. Navigate to Property and choose the goal asset
  2. Select Property → Decide the asset, which you wish to configure for automated approval.
  3. On the asset particulars web page, find Edit Subscription settings in the suitable pane.
  4. Select Edit subsequent to Subscription Required
    1. Choose Not Required within the dialogue field
    2. Affirm your choice

Customise SageMaker’s subscription workflow:

Whereas guide approval workflow stays important for manufacturing environments and delicate knowledge dealing with, organizations search to streamline and automate approvals for lower-risk environments and non-sensitive datasets. To realize this project-level automation, we will improve SageMaker’s native approval workflow by way of a customized event-driven resolution. This resolution leverages AWS’s serverless structure, combining utilizing AWS Lambda, Amazon EventBridge guidelines, and Amazon Easy Notification Service (Amazon SNS) to create an automatic approval workflow. This customization permits organizations to take care of governance whereas decreasing administrative overhead and accelerating the event cycle in non-critical environments. The event-driven method ensures real-time processing of approval requests, maintains audit trails, and may be configured to use totally different approval guidelines primarily based on venture traits and knowledge sensitivity ranges.

The customized workflow consists of the next steps:

  1. The information shopper submits a subscription request for a printed knowledge asset.
  2. SageMaker detects the request and generates a subscription occasion, which is mechanically despatched to EventBridge.
  3. EventBridge triggers the designated Lambda operate.
  4. The Lambda operate sends an AcceptSubscriptionRequest API name to SageMaker.
  5. The operate additionally sends a notification by way of Amazon SNS.
  6. AWS Lake Formation processes the permitted subscription and updates the related entry management lists (ACLs) and permission units.
  7. Lake Formation grants entry permissions to the information shopper’s venture AWS Identification and Entry Administration (IAM) position.
  8. The information shopper now has licensed entry to the requested knowledge asset and may start working with the subscribed knowledge.

The next diagram illustrates the high-level structure of the answer.

Key advantages

This resolution makes use of AWS Lambda and Amazon EventBridge to automate SageMaker subscription requests approvals, delivering the next advantages for organizations and end-users:

  • Scalability – Mechanically handles excessive volumes of subscription requests
  • Price-efficiency – Pay-as-you-go method with no idle useful resource prices
  • Minimal upkeep – Serverless elements require no infrastructure administration
  • Versatile triggering – Helps event-driven, scheduled, and guide invocation modes
  • Audit compliance – Complete logging and traceability by way of AWS CloudTrail

Step-by-step process

This part outlines the detailed course of for implementing a customized subscription request approval workflow in Amazon SageMaker

Create Lambda operate

Full the next steps to create your Lambda operate:

  1. On the Lambda console, select Features within the navigation pane.
  2. Select Create operate.
  3. Choose Writer from scratch.
  4. For Operate identify, enter a reputation for the operate.
  5. For Runtime, select your runtime (for this put up, we use Python model 3.9 or later).
  6. Select Create operate.
  7. On the Lambda operate web page, select the Configuration tab after which select Permissions.
  8. Notice the execution position to make use of when configuring the SageMaker venture.

Create SNS matter

For this resolution, we create SNS matter. Full the next steps to create the SNS matter for automated approvals:

  1. On the Amazon SNS console, select Matters within the navigation pane.
  2. Select Create matter.
  3. For Kind, choose Customary.
  4. For Title, enter a reputation for the subject.
  5. Select Create matter.
  6. On the SNS matter particulars web page, notice the SNS matter Amazon Useful resource Title (ARN) to make use of later within the Lambda operate.
  7. On Subscription tab, select Create Subscription.
  8. For Protocol, select E-mail.
  9. For Endpoint, enter e mail tackle of Information customers.

Create EventBridge rule

Full the next steps to create an EventBridge rule to seize subscription request occasions:

  1. On the EventBridge console, select Guidelines within the navigation pane.
  2. Select Create rule.
  3. For Title, enter a reputation for the rule.
  4. For Rule kind, choose Rule with occasion sample.
    This selection permits the automated subscription approval workflow to be triggered when a subscription request is initiated. Alternatively, you possibly can choose Schedule to schedule the rule to set off frequently. Seek advice from Making a rule that runs on a schedule in Amazon EventBridge to study extra.
  5. Select Subsequent.
  6. For Occasion supply, choose AWS occasions or EventBridge companion occasions.
  7. For Creation methodology, choose Use sample type
  8. For Occasion supply, choose AWS providers
  9. For AWS service, choose DataZone.
  10. For Occasion kind, choose Subscription Request Created.
  11. Configure your goal to route occasions to each the Lambda operate and SNS matter.
  12. Select Subsequent.
  13. For this put up, skip configuring tags and select Subsequent.
  14. Evaluate the settings and select Create rule.

Configure automation workflow

Full the next steps to configure the automation workflow:

  1. On the Lambda console, go to the operate you created.
  2. Configure the EventBridge rule to set off the Lambda operate
  3. Configure the vacation spot as SNS matter for occasion notification.

Configure code in Lambda operate

Full the next steps to configure your Lambda operate:

  1. On the Lambda console, go to the operate you created.
  2. Add the next code to your operate. Present the area ID, venture ID, and SNS matter ARN that you just famous earlier.
    import boto3
    import json
    import logging
    import os
    from botocore.exceptions import ClientError
    
    # Configure logging
    logger = logging.getLogger()
    logger.setLevel(logging.INFO)
    
    def lambda_handler(occasion, context):
        """Lambda operate to auto-approve subscription requests in Amazon SageMaker"""
        attempt:
            # Initialize purchasers
            datazone_client = boto3.consumer('datazone')
            sns_client = boto3.consumer('sns')
            
            # Get configuration from surroundings variables or use hardcoded values
            domain_id = os.environ.get('DOMAIN_ID', '')
            project_id = os.environ.get('PROJECT_ID', '')
            sns_topic_arn = os.environ.get('SNS_TOPIC_ARN', '')
            
            # Get pending subscription requests
            pending_requests = get_pending_requests(datazone_client, domain_id, project_id)
            
            if not pending_requests:
                logger.data("No pending subscription requests discovered")
                return
            
            # Course of requests
            for request in pending_requests:
                approve_request(datazone_client, sns_client, domain_id, request, sns_topic_arn)
                
        besides Exception as e:
            logger.error(f"Error: {str(e)}")
    
    def get_pending_requests(consumer, domain_id, project_id):
        """Get all pending subscription requests"""
        requests = []
        next_token = None
        
        attempt:
            whereas True:
                params = {
                    'domainIdentifier': domain_id,
                    'standing': 'PENDING',
                    'approverProjectId': project_id
                }
                
                if next_token:
                    params['nextToken'] = next_token
                
                response = consumer.list_subscription_requests(**params)
                
                if 'gadgets' in response:
                    requests.lengthen(response['items'])
                
                next_token = response.get('nextToken')
                if not next_token:
                    break
                    
            logger.data(f"Discovered {len(requests)} pending requests")
            return requests
            
        besides ClientError as e:
            logger.error(f"Error itemizing requests: {e}")
            return []
    
    def approve_request(datazone_client, sns_client, domain_id, request, sns_topic_arn):
        """Approve a subscription request and ship notification"""
        request_id = request.get('id')
        if not request_id:
            return
            
        attempt:
            # Approve the request
            datazone_client.accept_subscription_request(
                domainIdentifier=domain_id,
                identifier=request_id,
                decisionComment="Subscription request is auto-approved by Lambda"
            )
            
            # Ship notification
            asset_name = request.get('assetName', 'Unknown asset')
            
            message = f"Your subscription request has been auto-approved by Lambda. Now you can entry this asset."
            
            sns_client.publish(
                TopicArn=sns_topic_arn,
                Topic=f"Subscription Request is auto-approved by Lambda",
                Message=message
            )
            
            logger.data(f"Permitted request {request_id} for {asset_name}")
            
        besides Exception as e:
            logger.error(f"Error processing request {request_id}: {e}")

  3. Select Take a look at to check the Lambda operate code. To study extra about testing Lambda code, check with Testing Lambda features within the console.
  4. Select Deploy to deploy the code.

Configure Lambda and venture execution roles in SageMaker

Full the next steps:

  1. In SageMaker Unified Studio, go to your publishing venture.
  2. Select Members within the navigation pane.
  3. Select Add members.
  4. Add the Lambda execution position and venture execution roles as Contributor.

Take a look at the answer

Full the next steps to check the answer:

  1. In SageMaker Unified Studio, navigate to the information catalog and select Subscribe on the configured asset to provoke a subscription request.
  2. Select Subscription requests within the navigation pane to view the outgoing requests and select the Permitted tab to confirm automated approval.
  3. Select View subscription to substantiate the approver seems because the Lambda execution position with “Auto-approved by Lambda” as the rationale.
  4. On the CloudTrail console, select Occasion historical past to view the occasion you created and assessment the automated approval audit path.

Clear up

To keep away from incurring future expenses, clear up the assets you created throughout this walkthrough. The next steps use the AWS Administration Console, however it’s also possible to use the AWS CLI.

  1. Delete the SageMaker area. To make use of the AWS CLI, run the next instructions:
    aws sagemaker delete-project --project-name 
    aws datazone delete-domain –identifier 

  2. Delete the SNS subjects. To make use of the AWS CLI, run the next command:
    aws sns delete-topic --topic-arn 

  3. Delete the Lambda operate. To make use of the AWS CLI, run the next command:
    aws lambda delete-function --function-name 

Conclusion

Combining an event-driven structure with SageMaker creates an automatic, cost-effective resolution for knowledge governance challenges. This serverless method mechanically handles knowledge entry requests whereas sustaining compliance, so organizations can scale effectively as their knowledge grows. The answer mentioned on this put up will help knowledge groups entry insights sooner with minimal operational prices, making it a wonderful alternative for companies that want fast, compliant knowledge entry whereas maintaining their programs lean and environment friendly.

To study extra, go to the Amazon SageMaker Unified Studio web page.


Concerning the authors

Nira Jaiswal

Nira Jaiswal

Nira is a Principal Information Options Architect at AWS. Nira works with strategic prospects to architect and deploy modern knowledge and analytics options. She excels at designing scalable, cloud-based platforms that assist organizations maximize the worth of their knowledge investments. Nira is keen about combining analytics, AI/ML, and storytelling to remodel advanced info into actionable insights that ship measurable enterprise worth.

Ajit Tandale

Ajit Tandale

Ajit is a Senior Options Architect at AWS, specializing in knowledge and analytics. He companions with strategic prospects to architect safe, scalable knowledge programs utilizing AWS providers and open-source applied sciences. His experience consists of designing knowledge lakes, implementing knowledge pipelines, and optimizing massive knowledge processing workflows to assist organizations modernize their knowledge structure. Exterior of labor, he’s an avid reader and science fiction film fanatic.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles