cdk-ecr-deployment icon indicating copy to clipboard operation
cdk-ecr-deployment copied to clipboard

Push Doesn't Use Correct Destination

Open em-ctc opened this issue 3 years ago • 0 comments

I have a simple implementation like so:

new ecrDeploy.ECRDeployment(this, "DeployImage", {
  src: new ecrDeploy.DockerImageName("hello-world"),
  dest: new ecrDeploy.DockerImageName(
    repos.myRepo.repositoryUri + ":latest",
  ),
});

new lambda.DockerImageFunction(this, functionName, {
  "my-function",
  code: lambda.DockerImageCode.fromEcr(repos.lambda)
});

Even if I hard code the destination, an ECR repo that is differently named is created (eg: cdk-hnb659fds-container-assets-279758598245-us-east-1) and I get an error from Lambda:

... failed: Error: The stack named ... failed creation, it may need to be manually deleted from 
the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Source
image ....dkr.ecr.us-east-1.amazonaws.com/...:latest does not exist. Provide a valid source image...

Have tried many variations but cannot seem to get this to work.

em-ctc avatar Jun 23 '22 03:06 em-ctc