@@ -93,7 +93,7 @@ export class ContainerImageBuild extends Construct implements IGrantable {
9393 const handler = new SingletonFunction ( this , 'CustomResourceHandler' , {
9494 // Use raw string to avoid from tightening CDK version requirement
9595 runtime : new Runtime ( 'nodejs22.x' , RuntimeFamily . NODEJS ) ,
96- code : Code . fromAsset ( join ( __dirname , '../ lambda/ trigger-codebuild/ dist' ) ) ,
96+ code : Code . fromAsset ( join ( __dirname , '..' , ' lambda' , ' trigger-codebuild' , ' dist') ) ,
9797 handler : 'index.handler' ,
9898 uuid : 'db740fd5-5436-4a84-8a09-e6dfcd01f4f3' , // generated for this construct
9999 lambdaPurpose : 'DeployTimeBuildCustomResourceHandler' ,
@@ -111,6 +111,7 @@ export class ContainerImageBuild extends Construct implements IGrantable {
111111 if ( repository === undefined ) {
112112 repository = new Repository ( this , 'Repository' , { removalPolicy : RemovalPolicy . DESTROY } ) ;
113113 ( repository . node . defaultChild as CfnResource ) . addPropertyOverride ( 'EmptyOnDelete' , true ) ;
114+ ( repository . node . defaultChild as CfnResource ) . addPropertyOverride ( 'ImageScanningConfiguration.ScanOnPush' , true ) ;
114115 }
115116 const repositoryUri = repository . repositoryUri ;
116117 const imageArtifactName = 'artifact:$imageTag' ;
@@ -187,7 +188,7 @@ curl -i -X PUT -H 'Content-Type:' -d "@payload.json" "$responseURL"
187188 new PolicyStatement ( {
188189 actions : [ 'codebuild:StartBuild' ] ,
189190 resources : [ project . projectArn ] ,
190- } ) ,
191+ } )
191192 ) ;
192193
193194 this . grantPrincipal = project . grantPrincipal ;
@@ -245,13 +246,13 @@ curl -i -X PUT -H 'Content-Type:' -d "@payload.json" "$responseURL"
245246 if ( this . props . zstdCompression ) {
246247 throw new Error ( 'You cannot enable zstdCompression for a Lambda image.' ) ;
247248 }
248- return DockerImageCode . fromEcr ( this . repository , {
249+ return DockerImageCode . fromEcr ( this . repository , {
249250 tagOrDigest : this . imageTag ,
250251 ...( options && {
251252 cmd : options . cmd ,
252253 entrypoint : options . entrypoint ,
253254 workingDirectory : options . workingDirectory ,
254- } )
255+ } ) ,
255256 } ) ;
256257 }
257258
0 commit comments