Skip to content
GitHubXDiscord

Space

The Space resource lets you manage AWS SageMaker Spaces which provide a collaborative environment for data scientists and developers to share resources, tools, and workflows.

Create a basic SageMaker Space with required properties and one optional property.

import AWS from "alchemy/aws/control";
const sageMakerSpace = await AWS.SageMaker.Space("mySageMakerSpace", {
DomainId: "d-1234567890",
SpaceName: "dataScienceTeam",
SpaceDisplayName: "Data Science Team Space"
});

Configure a SageMaker Space with advanced settings including space settings, sharing settings, and tags.

const advancedSageMakerSpace = await AWS.SageMaker.Space("advancedSageMakerSpace", {
DomainId: "d-1234567890",
SpaceName: "advancedDataScience",
SpaceDisplayName: "Advanced Data Science Space",
SpaceSettings: {
JupyterServerAppSettings: {
LifecycleConfigArns: [
"arn:aws:sagemaker:us-west-2:123456789012:lifecycle-config/myLifecycleConfig"
]
}
},
SpaceSharingSettings: {
ShareSpace: true
},
Tags: [
{
Key: "Team",
Value: "DataScience"
}
]
});

Create a SageMaker Space with specific ownership settings to control the access and management of the space.

const ownershipConfiguredSpace = await AWS.SageMaker.Space("ownershipConfiguredSpace", {
DomainId: "d-1234567890",
SpaceName: "ownershipControlledSpace",
OwnershipSettings: {
Owner: "user@example.com",
AllowExternalAccess: false
}
});

Set up a SageMaker Space that allows sharing with other users or groups.

const sharedSageMakerSpace = await AWS.SageMaker.Space("sharedSageMakerSpace", {
DomainId: "d-1234567890",
SpaceName: "sharedDataScience",
SpaceDisplayName: "Shared Data Science Space",
SpaceSharingSettings: {
ShareSpace: true,
SharedWith: [
{
UserId: "user1@example.com"
},
{
UserId: "user2@example.com"
}
]
}
});