1 Answer
- Newest
- Most votes
- Most comments
0
I would find a way to reference the same image tag in your cdk app that you use in your image build/tag/push stage.
For example, if you had a docker stage that pushed an image using the environment variable CODEBUILD_RESOLVED_SOURCE_VERSION
as the tag like:
docker build -t $IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION . docker push $IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION
You could then reference that tag in your CDK app:
const tag = process.env.CODEBUILD_RESOLVED_SOURCE_VERSION; const image = ecs.ContainerImage.fromEcrRepository(ecrRepo, tag); new ApplicationLoadBalancedFargateService(this, 'Service', { taskImageOptions: { image: image, ... }, ... });
answered 4 years ago
Relevant content
- asked 4 months ago
- asked 8 months ago
- asked 6 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago