Skip to content

Commit 15170ef

Browse files
authored
Merge pull request #66 from hsohail94/hsohail94/ebs-volume-name-fix
feat(add): Add parameter to specify device name for image's EBS volume
2 parents 3797314 + a58375d commit 15170ef

File tree

6 files changed

+195
-167
lines changed

6 files changed

+195
-167
lines changed

API.md

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export interface ImagePipelineProps {
8383
* Configuration for the AMI's EBS volume
8484
*/
8585
readonly ebsVolumeConfiguration?: imagebuilder.CfnImageRecipe.EbsInstanceBlockDeviceSpecificationProperty;
86+
/**
87+
* Name of the AMI's EBS volume
88+
*/
89+
readonly ebsVolumeName?: string;
8690
}
8791

8892
export class ImagePipeline extends Construct {
@@ -165,10 +169,11 @@ export class ImagePipeline extends Construct {
165169
},
166170
};
167171
};
168-
if (props.ebsVolumeConfiguration) {
172+
if (props.ebsVolumeConfiguration && props.ebsVolumeName) {
169173
imageRecipeProps = {
170174
...imageRecipeProps,
171175
blockDeviceMappings: [{
176+
deviceName: props.ebsVolumeName,
172177
ebs: props.ebsVolumeConfiguration,
173178
}],
174179
};

test/imagepipeline.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const propsWithVolumeConfig: ImagePipelineProps = {
4343
kmsKeyAlias: 'alias/app1/key',
4444
securityGroups: ['sg-12345678'],
4545
subnetId: 'subnet-12345678',
46+
ebsVolumeName: '/dev/xvda',
4647
ebsVolumeConfiguration: {
4748
encrypted: true,
4849
iops: 200,
@@ -134,6 +135,7 @@ test('Infrastructure Configuration is built with provided EBS volume properties'
134135
Name: 'TestImageRecipe',
135136
BlockDeviceMappings: [
136137
{
138+
DeviceName: '/dev/xvda',
137139
Ebs: {
138140
Encrypted: true,
139141
Iops: 200,

0 commit comments

Comments
 (0)