-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
…28658) Error: ```bash Error: Cannot find entry file at /node_modules/@aws-cdk/custom-resource-handlers/dist/ aws-amplify-alpha/asset-deployment-handler/index.js ``` In #27955, we migrated the aws-amplify-alpha custom resource to `@aws-cdk/custom-resource-handlers`, our internal package for storing all custom resources. However, this migration was half-baked. The reason is because we seem to have depended on our `@aws-cdk/custom-resource-handlers` package directly. That works locally, as we have `custom-resource-handlers` readily available. ``` |-- @aws-cdk |-- aws-amplify-alpha |-- custom-resource-handlers ``` `aws-amplify-alpha` directly went into `custom-resource-handlers` to grab the necessary entry file. This works locally, because we have access to all folders with impunity. Of course, when packaged and published, we publish only `aws-amplify-alpha` with no other outside folders: ``` |-- @aws-cdk |-- aws-amplify-alpha ``` Thus, the published module would not have access to the file under `custom-resource-handlers`, and predictably fails at synth time. In `aws-cdk-lib`, we airlift the necessary files _into_ the package and release it alongside `aws-cdk-lib`: ``` |-- aws-cdk-lib |-- aws-synthetics |-- custom-resource-handlers/dist/aws-synthetics/custom-resource-handler // this was airlifted into aws-cdk-lib ``` We are supposed to do the same airlift mechanism for `aws-amplify-alpha` but somehow that was forgotten. This PR adds in the necessary structure, so now `aws-amplify-alpha` looks like this: ``` |-- @aws-cdk |-- aws-amplify-alpha |-- custom-resource-handlers/dist/aws-amplify-alpha // airlifted in via this PR |-- custom-resource-handlers/dist |-- aws-amplify-alpha ``` (please excuse my horrible ascii notation) Fixes #28633. Fixes #28089. I tested my locally packaged `aws-amplify-alpha` on a local CDK app to confirm that the necessary structure exists in the packaged module. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,6 @@ junit.xml | |
test/ | ||
!*.lit.ts | ||
**/*.snapshot | ||
|
||
# include custom-resource-handlers | ||
!custom-resource-handlers/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
scriptdir=$(cd $(dirname $0) && pwd) | ||
customresourcedir=$(node -p "path.dirname(require.resolve('@aws-cdk/custom-resource-handlers/package.json'))") | ||
awscdklibdir=${scriptdir}/.. | ||
|
||
list_custom_resources() { | ||
for file in $customresourcedir/dist/aws-amplify-alpha/*/index.js; do | ||
echo $file | rev | cut -d "/" -f 2-4 | rev | ||
done | ||
} | ||
|
||
customresources=$(list_custom_resources) | ||
|
||
echo $customresources | ||
|
||
cd $awscdklibdir | ||
mkdir -p $awscdklibdir/custom-resource-handlers | ||
|
||
for cr in $customresources; do | ||
mkdir -p $awscdklibdir/custom-resource-handlers/$cr | ||
cp $customresourcedir/$cr/index.js $awscdklibdir/custom-resource-handlers/$cr | ||
done |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.