Amazon SageMaker Ground Truth with CDK

0

Hi team,

I would like to use CDK for IaC to create an Amazon SageMaker Ground Truth solution. Specifically, I want to Create a private team with AWS Cognito and then create a labeling job for image classification (multi-label).

However, I couldn’t find a CDK construct that supports creating a private team with AWS Cognito and a labeling job.

Is SageMaker Ground Truth supported by CDK constructs, or would I need to use custom resources or SDK calls for this?

any example is appreciated to create the private workforce and the labelling image job

if I should create the cognito user pool separately from CDK and then associate it to the sagemaker ground truth work team what would be the correct

configuration of this user pool and app_client integration (Allowed callback URLs, Allowed sign-out URLs, ....)

Thank you!

1 Answer
0

As of now, Amazon SageMaker Ground Truth does not have dedicated L2 constructs in the AWS CDK specifically for creating private teams with AWS Cognito or labeling jobs for image classification. However, you can still implement this solution using CDK, albeit with a bit more manual configuration.

To create a private team with AWS Cognito, you would need to use the CDK constructs for Amazon Cognito to set up the user pool and identity pool. You can then use the AWS SDK or custom resources within your CDK stack to configure the SageMaker workforce and work team.

For creating a labeling job for image classification (multi-label), you would likely need to use custom resources or the AWS SDK within your CDK stack. This is because the specific configurations for Ground Truth labeling jobs are not directly exposed through CDK constructs.

Here's a high-level approach you could take:

  1. Use CDK's Cognito constructs to create the user pool and identity pool for your private workforce.
  2. Create a custom resource or use the AWS SDK to set up the SageMaker private workforce and work team, linking it to the Cognito user pool.
  3. Use another custom resource or the AWS SDK to create the labeling job for image classification, specifying all the necessary parameters such as the input/output S3 locations, labeling category configuration, and worker task template.

While this approach requires more manual configuration compared to having dedicated L2 constructs, it allows you to achieve your desired setup using CDK for infrastructure as code. Keep in mind that you'll need to handle the integration between these components carefully to ensure they work together correctly.

As the AWS CDK is continuously evolving, it's worth keeping an eye on future releases for potential additions of more specific constructs for SageMaker Ground Truth. In the meantime, this custom approach should allow you to create your desired solution using CDK.
Sources
Create a Private Workforce (Amazon Cognito) - Amazon SageMaker
Create a Private Workforce (Amazon SageMaker Console) - Amazon SageMaker
Create a data labeling project with Amazon SageMaker Ground Truth Plus | AWS Machine Learning Blog

profile picture
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions