Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(amplify): addBranch fails synth with "cannot find entry file..." #28658

Merged
merged 11 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-amplify-alpha/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ junit.xml
test/
!*.lit.ts
**/*.snapshot

# include custom-resource-handlers
!custom-resource-handlers/*
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-amplify-alpha/lib/branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class AmplifyAssetDeploymentProvider extends NestedStack {
this,
'amplify-asset-deployment-on-event',
{
entry: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-amplify-alpha', 'asset-deployment-handler', 'index.js'),
entry: path.join(__dirname, '..', 'custom-resource-handlers', 'dist', 'aws-amplify-alpha', 'asset-deployment-handler', 'index.js'),
handler: 'onEvent',
initialPolicy: [
new iam.PolicyStatement({
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-amplify-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@
"cdk-build": {
"env": {
"AWSLINT_BASE_CONSTRUCT": true
}
},
"pre": [
"./scripts/airlift-custom-resource-handlers.sh"
]
},
"keywords": [
"aws",
Expand Down
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.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/d1af98ce124bb93199d3d45ff8930b99badcdd089777b7976a0ad9af56d220f6.json"
"/2f9d2632b48a4f92f6691c3e3cfcbeb47798c945a2d03b93514de1a3d3ec72ed.json"
]
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9307ab790c544d7c4d94504a1c950222bbfc119c2c12b44440ad46939e0b6364.zip"
"S3Key": "85f7bb0ac0b4da3571afd49c891d631f4f07c0ef710a02046d3a9abd8d9d4604.zip"
},
"Environment": {
"Variables": {
Expand Down

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.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"AppF1B96344": {
"Type": "AWS::Amplify::App",
"Properties": {
"Name": "App",
"BasicAuthConfig": {
"EnableBasicAuth": false
},
Expand All @@ -62,13 +61,14 @@
"Arn"
]
},
"Name": "App",
"Platform": "WEB",
"Repository": {
"Fn::GetAtt": [
"Repo02AC86CF",
"CloneUrlHttp"
]
},
"Platform": "WEB"
}
}
},
"AppmainF505BAED": {
Expand Down Expand Up @@ -120,4 +120,4 @@
]
}
}
}
}

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.

Loading
Loading