aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.35k stars 3.77k forks source link

amplify-alpha: addBranch fails #28879

Open PetroLiubynskyi opened 5 months ago

PetroLiubynskyi commented 5 months ago

Describe the bug

Previously resolved issue allows to make a step forward, but the whole process of deployment of angular app to Amplify still does not work.

The following error appears during cdk deploy execution

image ..... image ..... `Bundling asset /com.amazonaws.cdk.custom-resources.amplify-asset-deployment-provider/amplify-asset-deployment-on-event/Code/Stage... esbuild cannot run locally. Switching to Docker bundling.

✘ [ERROR] Could not resolve "/tmp/jsii-kernel-yOr44c/node_modules/@aws-cdk/aws-amplify-alpha/custom-resource-handlers/dist/aws-amplify-alpha/asset-deployment-handler/index.js" `

Expected Behavior

Amplify branch should be created from an asset

Current Behavior

Amplify branch is not created from an asset

Reproduction Steps

Execute the code

amplify_app = amplify.App(
            self, 
            "Amplify",
            app_name="my-app",
            platform=amplify.Platform.WEB
        )

deployed_bundle = assets.Asset(
            self,
            "DeployedBundle",
            path=bundle_path)

amplify_app.add_branch(
            "AmplifyBranch",
            branch_name=env,
            asset=deployed_bundle,
            auto_build=False,
            pull_request_preview=False
        )

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

aws-cdk.aws-amplify-alpha==2.123.0a0

Framework Version

aws-cdk-lib==2.123.0

Node.js Version

18.14.0

OS

Windows 11 Pro

Language

Python

Language Version

3.10.11

Other information

No response

pahud commented 5 months ago

probably related to https://github.com/aws/aws-cdk/issues/28764. Is it still failing in the latest cdk v2.124.0 ?

github-actions[bot] commented 5 months ago

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

PetroLiubynskyi commented 5 months ago

probably related to #28764. Is it still failing in the latest cdk v2.124.0 ?

The funny thing that it is not. Because there were 2 issues: #28764 and previously created by me #28633 that were closed by #28760

This allowed me to make a step forward and to see that cdk deploy at least started. But the same error appears later in the flow.