aws-amplify / aws-amplify/amplify-cli

Source image xxx.dkr.ecr.us-east-1.amazonaws.com/aws-cdk/assets:xxx does not exist. Provide a valid source image.

Open
#9,935 3 comments 0 reactions 0 assignees View on GitHub
bug extensibility p2
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

sudo npm

### If applicable, what version of Node.js are you using?

v16.14.0

### Amplify CLI Version

7.6.23

### What operating system are you using?

Ubuntu

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No.

### Amplify Categories

custom

### Amplify Commands

push

### Describe the bug

Running `amplify push` with a custom resource that uses [`lambda.DockerImageCode.fromImageAsset`](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-lambda.DockerImageCode.html#static-fromwbrimagewbrassetdirectory-props) fails with the titular error message.

### Expected behavior

The docker image should build and then be uploaded to ECR, then the lambda deployed.

### Reproduction steps

1. `amplify add custom`
2. Select CDK
3. In the CDK stack, add a function that points to a Dockerfile:
```ts
const fn = new lambda.DockerImageFunction(this, 'someLambda', {
code: lambda.DockerImageCode.fromImageAsset(path.resolve(__dirname, '../path/to/docker')),
});
```
4. `amplify push`
5. You will get the error: Source image xxx.dkr.ecr.us-east-1.amazonaws.com/aws-cdk/assets:xxx does not exist. Provide a valid source image.

### GraphQL schema(s)

n/a

### Log output

```
# Put your logs below this line

```

### Additional information

I assume this relates to the custom StackSynthesizer used by AWS Amplify, because it seems unable to handle CDK assets in the proper way.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.