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?

AlexR
preguntada hace 2 meses128 visualizaciones
1 Respuesta
1
Respuesta aceptada

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
respondido hace 2 meses
profile picture
EXPERTO
revisado hace 2 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas