SageMaker Studio: Export EFS interface object not just EFS ID
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 74
Description
### Describe the feature
- Currently, [sagemaker.CfnDomain()](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnDomain.html) does not accept external EFS file system as input.
- All the CfnDomain() calls will create its own EFS file system.
- CfnDomain provides [`attrHomeEfsFileSystemId`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnDomain.html#attrhomeefsfilesystemid).
- The problem with this EFS ID is that this is a CDK token instead of the real EFS ID.
- Therefore, if we use the following import to use the EFS FS, like this, it will fail.
```
const sg = ec2.SecurityGroup.fromLookupById(
this,
prefix + "-SG-EFS",
"sg-abcdef"
);
const efs_fs = efs.FileSystem.fromFileSystemAttributes(
this,
prefix + "-EFS-FS",
{ securityGroup: sg, fileSystemId: cfnDomain.attrHomeEfsFileSystemId }
);
```
- Therefore, it would be really appreciated if CfnDomain provides the actual EFS interface object (`efs.IFileSystem`) instead of the EFS ID.
- The only workaround is to create a separate CDK stack to import the EFS FS.
### Use Case
When the customer needs to mount an EFS FS created from SageMaker Studio to figure out how much space each users are using.
### Proposed Solution
The new CfnDomain provides the actual EFS interface object (`efs.IFileSystem`) instead of the EFS ID.
### Other Information
_No response_
### Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.77.0
### Environment details (OS name and version, etc.)
MacOS (13.3.1 (a) (22E772610a))
Contributor guide
Research direction
Start with the aws_sagemaker.CfnDomain entry point and its attrHomeEfsFileSystemId output, then compare the efs.IFileSystem interface with the fromFileSystemAttributes usage shown in the issue. Determine how to expose the SageMaker home EFS as an interface object while preserving existing behavior; done means consumers can use the domain-created EFS without a separate stack.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100