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 Risposta
1
Risposta accettata

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
con risposta 2 mesi fa
profile picture
ESPERTO
verificato 2 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande