aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
AWS::SageMaker::Domain does not delete EFS share on stack delete
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### Name of the resource
AWS::SageMaker::Domain
### Resource Name
_No response_
### Issue Description
SageMaker Studio Domains deploy an EFS share as part of its resource provisioning. When deleting a stack that contains AWS::SageMaker::Domain CloudFormation does not delete the EFS share associated with the domain.
### Expected Behavior
When a stack containing a domain is deleted, the EFS share that was implicitly created with the domain should be deleted as well.
### Observed Behavior
The EFS share was not deleted. If the subnet is in the same Stack, the stack will enter a failed state because the network will fail to delete due to the EFS network adapter still being attached.
### Test Cases
- Create a SageMaker Studio Domain using CloudFormation
- Delete the Stack
- Check EFS, the share will still exist
### Other Details
Some users may wish to preserve their data which could be supported using the RetentionPolicy parameter to the delete_domain() call as done in this example that uses a custom resource to manage the SageMaker Domain.
https://github.com/aws-samples/cloudformation-studio-domain/blob/main/domain_function.py
RetentionPolicy={
'HomeEfsFileSystem': 'Delete'
}
Contributor guide
Research direction
Reproduce the issue using the listed CloudFormation steps, then inspect the linked domain_function.py example and its delete_domain() RetentionPolicy handling. Done means stack deletion removes the implicitly created EFS share, while the documented retention option preserves user data when requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100