cdk-ecr-deployment
cdk-ecr-deployment copied to clipboard
Push Doesn't Use Correct Destination
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.