@@ -25,6 +25,16 @@ export interface ComponentProps {
2525 */
2626 readonly version : string ;
2727}
28+ export interface VolumeProps {
29+ /**
30+ * Name of the volume
31+ */
32+ readonly deviceName : string ;
33+ /**
34+ * EBS Block Store Parameters
35+ */
36+ readonly ebs : imagebuilder . CfnImageRecipe . EbsInstanceBlockDeviceSpecificationProperty ;
37+ }
2838
2939export interface ImagePipelineProps {
3040 /**
@@ -78,8 +88,8 @@ export interface ImagePipelineProps {
7888 */
7989 readonly platform ?: string ;
8090 /**
81- * Email used to receive Image Builder Pipeline Notifications via SNS
82- */
91+ * Email used to receive Image Builder Pipeline Notifications via SNS
92+ */
8393 readonly email ?: string ;
8494 /**
8595 * List of security group IDs for the Infrastructure Configuration
@@ -90,13 +100,9 @@ export interface ImagePipelineProps {
90100 */
91101 readonly subnetId ?: string ;
92102 /**
93- * Configuration for the AMI's EBS volume
94- */
95- readonly ebsVolumeConfiguration ?: imagebuilder . CfnImageRecipe . EbsInstanceBlockDeviceSpecificationProperty ;
96- /**
97- * Name of the AMI's EBS volume
103+ * Configuration for the AMI's EBS volumes
98104 */
99- readonly ebsVolumeName ?: string ;
105+ readonly ebsVolumeConfigurations ?: VolumeProps [ ] ;
100106 /**
101107 * Set to true if you want to enable continuous vulnerability scans through AWS Inpector
102108 */
@@ -217,13 +223,10 @@ export class ImagePipeline extends Construct {
217223 } ,
218224 } ;
219225 } ;
220- if ( props . ebsVolumeConfiguration && props . ebsVolumeName ) {
226+ if ( props . ebsVolumeConfigurations ) {
221227 imageRecipeProps = {
222228 ...imageRecipeProps ,
223- blockDeviceMappings : [ {
224- deviceName : props . ebsVolumeName ,
225- ebs : props . ebsVolumeConfiguration ,
226- } ] ,
229+ blockDeviceMappings : props . ebsVolumeConfigurations ,
227230 } ;
228231 }
229232 imageRecipe = new imagebuilder . CfnImageRecipe ( this , 'ImageRecipe' , imageRecipeProps ) ;
@@ -274,7 +277,7 @@ export class ImagePipeline extends Construct {
274277 LaunchPermissionConfiguration : {
275278 UserIds : props . distributionAccountIDs ,
276279 } ,
277- KmsKeyId : props . ebsVolumeConfiguration ?. kmsKeyId ?? 'aws/ebs' , //use default AWS-managed key if one isn't given
280+ KmsKeyId : props . ebsVolumeConfigurations ? props . ebsVolumeConfigurations [ 0 ] . ebs . kmsKeyId : 'aws/ebs' , //use default AWS-managed key if one isn't given
278281 } ,
279282 } ;
280283 distributionsList . push ( distributionConfig ) ;
0 commit comments