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 réponse
1
Réponse acceptée

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
répondu il y a 2 mois
profile picture
EXPERT
vérifié il y a 2 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions