Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(sagemaker): Add L2 construct for ModelPackageGroup #53

Open
1 of 3 tasks
bweigel opened this issue Sep 18, 2024 · 0 comments
Open
1 of 3 tasks

(sagemaker): Add L2 construct for ModelPackageGroup #53

bweigel opened this issue Sep 18, 2024 · 0 comments

Comments

@bweigel
Copy link
Contributor

bweigel commented Sep 18, 2024

Is your feature request related to a problem? Please describe.

Currently, managing SageMaker Model Package Groups with AWS CDK requires the use of lower-level (L1) constructs, adding complexity to CDK code. By introducing an L2 construct, developers can more easily interact with and manage Model Package Groups, which are essential in MLOps workflows for storing, versioning, and sharing machine learning models.

Would you be willing to help with a PR?

  • Yes, absolutely
  • Yes, with some guidance
  • Unfortunately no time :'-(

Describe the solution you'd like

I propose the creation of L2 construct to manage ModelPackageGroup resources.

Features could include:

  • permissions management using grant, also cross account access possibilities

Additional context

ℹ️ This is basically created with AI, from the API.md of the constructs we use internally.

The ModelPackageGroup L2 construct will define the properties and methods needed to manage a SageMaker Model Package Group. It will allow the ability to manage access policies and permissions.

ModelPackageGroup Construct

  • Implements: IModelPackageGroup
  • Properties:
    • modelPackageGroupName (string, required): Name of the SageMaker Model Package
    • description (string, optional): A description for the model package group.
    • modelPackageGroupArn (string): Returns the ARN of the model package group.
    • creationTime (string, optional): The creation time of the model package group.
    • status (string, optional): Status of the model package group.
  • Methods:
    • grantAccess(grantee: IGrantable): Grants read access to the model package group to the specified IAM principal (e.g. role, user, group).
    • addToResourcePolicy(statement: PolicyStatement): Adds a statement to the resource policy for controlling access to the model package group.
  • Static Methods:
    • fromModelPackageGroupArn(scope: Construct, id: string, modelPackageGroupArn: string): Imports an existing Model Package Group using its ARN.
    • fromModelPackageGroupName(scope: Construct, id: string, modelPackageGroupName: string): Imports an existing Model Package Group using its name.

Usage example

const modelPackageGroup = new ModelPackageGroup(this, 'MyModelPackageGroup', {
  modelPackageGroupName: 'MyModelGroup',
  description: 'A group for versioning my machine learning models',
});

const role = new iam.Role(this, 'myrole', ...);

// Grant SageMaker role access to the model package group
modelPackageGroup.grantAccess(role);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant