aws-autoscaling: the ability to set an kmsKey for encryption of ebs volumes
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
Research direction
Start in packages/aws-cdk-lib/aws-autoscaling/lib/volume.ts and compare its EBS volume options with packages/aws-cdk-lib/aws-ec2/lib/volume.ts at the referenced line. Add support for the KMS key option in autoscaling volumes and verify that the example can pass kmsKey and produce encrypted EBS volumes.
Written by the indexing model from the issue text.
Description
Describe the feature
It looks like that there is no option to set the kmsKey prop for Autoscaling Group volumes. See https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-autoscaling/lib/volume.ts
In the ec2 volume.ts file it is, see https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-ec2/lib/volume.ts#L132
Use Case
to encrypt ebs volumes in autoscaling groups
Proposed Solution
adding the property to the volume.ts file in the autoscaling group module
Other Information
example showing the difference:
import { App, Stack, StackProps } from 'aws-cdk-lib';
import {
Instance,
InstanceClass,
InstanceSize,
InstanceType,
MachineImage,
BlockDeviceVolume as EC2BDV,
EbsDeviceVolumeType as EC2EVT,
Vpc,
} from 'aws-cdk-lib/aws-ec2';
import {
AutoScalingGroup,
BlockDeviceVolume as ASGBDV,
EbsDeviceVolumeType as ASGEVT,
} from 'aws-cdk-lib/aws-autoscaling';
import { Key } from 'aws-cdk-lib/aws-kms';
export class ServerStack extends Stack {
constructor(scope: App, id: string, props: StackProps) {
super(scope, id, props);
const vpc = new Vpc(this, 'vpc-id');
const kmsKey = new Key(this, 'kmsKey', {});
new AutoScalingGroup(this, 'ASG', {
instanceType: InstanceType.of(InstanceClass.M7I, InstanceSize.XLARGE),
machineImage: MachineImage.latestAmazonLinux2023(),
vpc,
blockDevices: [
{
deviceName: '/dev/sda1',
volume: ASGBDV.ebs(150, {
volumeType: ASGEVT.GP3,
throughput: 250,
kmsKey: kmsKey, // this property does not exist
}),
},
],
});
new Instance(this, 'EC2', {
instanceType: InstanceType.of(InstanceClass.M7I, InstanceSize.XLARGE),
machineImage: MachineImage.latestAmazonLinux2023(),
vpc,
blockDevices: [
{
deviceName: '/dev/sda1',
volume: EC2BDV.ebs(150, {
volumeType: EC2EVT.GP3,
throughput: 250,
kmsKey: kmsKey,
}),
},
],
});
}
}
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS CDK Library version (aws-cdk-lib)
2.263.0
AWS CDK CLI version
2.1134.0
Environment details (OS name and version, etc.)
node 24 on macOS
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 71
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-cdk
-
@aws-cdk/aws-bedrock-agentcore-alpha bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
@aws-cdk/aws-rds effort/small feature-request p2
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
@aws-cdk/aws-cloudwatch effort/medium feature-request p2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
@aws-cdk/aws-s3-deployment bug p2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
@aws-cdk/aws-lambda-nodejs effort/medium feature-request p2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100