(ec2): Cannot attach Volume to Instance
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 74
Description
ec2.Instance only currently supports attaching volumes with type BlockDeviceVolume.
See
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Instance.html#blockdevices
and
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.BlockDevice.html
### Use Case
CloudFormation supports attaching Volumes created separately from the Instance. It would be nice to have the same support for the L2 CDK classes.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-volumes
### Proposed Solution
I believe this would involve adding a new property, `volumes` to [Instance](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Instance.html#blockdevices) of a type that maps a device name to [Volume](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Volume.html).
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-mount-point.html
### Other
* [ ] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change
---
This is a :rocket: Feature Request
Contributor guide
Research direction
Start with the EC2 Instance, BlockDeviceVolume, and Volume APIs, then compare them with CloudFormation's volumes and mount-point properties. Done means Instance supports attaching separately created Volumes by device name, matching the requested L2 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, 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