aws / aws/aws-cdk

amplify-alpha: addBranch fails

Open
#28,879 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-amplify bug effort/medium p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

Previously resolved [issue ](https://github.com/aws/aws-cdk/pull/28760) 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](https://github.com/aws/aws-cdk/assets/124598808/5309f21a-d637-44dc-a198-265624aa6ae0)
.....
![image](https://github.com/aws/aws-cdk/assets/124598808/4c64c55b-b535-48cc-bfae-1dd469894067)
.....
`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
```python
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_

Contributor guide

Open the contributing guide

Research direction

Reproduce the Python add_branch example with cdk deploy and inspect the bundling failure for custom-resource-handlers/dist/aws-amplify-alpha/asset-deployment-handler/index.js. Trace how add_branch resolves the asset handler and verify that an asset-backed Amplify branch is created successfully without the esbuild or Docker path-resolution error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, python, typescript
Domain
build-system, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.