how to get ECR Image URL while still preserving ability to do "cdk deploy --all"?

0

I have a CDK Pipeline that creates a Docker Image using DockerImageAsset and then deploys it to Elasticbeanstalk via ECR using a Dockerrun.aws.json.

To make this work, I had to split the deployment into two, so that the EB portion can have the generated image URL from ECR passed in as context. This value is not available during synth, so it requires a deploy followed by a synth of the next stack.

I created a shell script that runs the first deploy, captures the output, then runs the second deploy. This shell script is small but would need to grow to support additional parameters over time.

I'd like to go back to a solution where all the logic is contained within CDK stacks, to the point where a simple "cdk deploy --all" works correctly again.

What are my options?

1 Answer
1
Accepted Answer

Fixed by writing the image URL to an ssm.StringParameter instead of a CfnOutput. Kind of surprised it worked, it's not documented anywhere, I just tried it on a whim and got lucky.

AlexR
answered 2 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions