@@ -66,6 +66,24 @@ async function fixCdkPaths(awsCdkLibPath) {
6666 const pathsFix = {
6767 'custom-resource-handlers/' : `${ awsCdkLibPath } /custom-resource-handlers/` ,
6868 'aws-custom-resource-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/custom-resources/aws-custom-resource-handler` ,
69+ 'auto-delete-objects-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-s3/auto-delete-objects-handler` ,
70+ 'notifications-resource-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-s3/notifications-resource-handler` ,
71+ 'drop-spam-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-ses/drop-spam-handler` ,
72+ 'aws-stepfunctions-tasks/role-policy-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-stepfunctions-tasks/role-policy-handler` ,
73+ 'eval-nodejs-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-stepfunctions-tasks/eval-nodejs-handler` ,
74+ 'cross-account-zone-delegation-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-route53/cross-account-zone-delegation-handler` ,
75+ 'delete-existing-record-set-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-route53/delete-existing-record-set-handler` ,
76+ 'aws-api-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-events-targets/aws-api-handler` ,
77+ 'log-retention-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-logs/log-retention-handler` ,
78+ 'cluster-resource-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-eks/cluster-resource-handler` ,
79+ 'auto-delete-images-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-ecr/auto-delete-images-handler` ,
80+ 'bucket-deployment-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-s3-deployment/bucket-deployment-handler` ,
81+ 'nodejs-entrypoint-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/core/nodejs-entrypoint-handler` ,
82+ 'restrict-default-security-group-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-ec2/restrict-default-security-group-handler` ,
83+ 'dns-validated-certificate-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-certificatemanager/dns-validated-certificate-handler` ,
84+ 'auto-delete-underlying-resources-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-synthetics/auto-delete-underlying-resources-handler` ,
85+ 'replica-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-dynamodb/replica-handler` ,
86+ 'oidc-handler' : `${ awsCdkLibPath } /custom-resource-handlers/dist/aws-iam/oidc-handler` ,
6987 } ;
7088
7189 // Create a proxy to intercept calls to the path module so we can fix paths
@@ -90,6 +108,23 @@ async function fixCdkPaths(awsCdkLibPath) {
90108
91109 return resolvedPath ;
92110 }
111+ if ( prop === 'join' ) {
112+ let resolvedPath = target [ prop ] . apply ( target , args ) ;
113+
114+ for ( const [ key , value ] of Object . entries ( pathsFix ) ) {
115+ if ( resolvedPath . includes ( key ) ) {
116+ // replace the beginning of the path with the value
117+ const i = resolvedPath . indexOf ( key ) ;
118+ const newResolvedPath = `${ value } ${ resolvedPath . substring ( i + key . length ) } ` ;
119+ Logger . verbose (
120+ `[CDK] [Worker] Fixing path ${ resolvedPath } -> ${ newResolvedPath } ` ,
121+ ) ;
122+ resolvedPath = newResolvedPath ;
123+ }
124+ }
125+
126+ return resolvedPath ;
127+ }
93128 return target [ prop ] . apply ( target , args ) ;
94129 } ;
95130 }
0 commit comments