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개 답변
1
수락된 답변

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
답변함 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠