From 377a3c9bd3643335355a19ed080b5bd4c19c665c Mon Sep 17 00:00:00 2001 From: Mario Savarese <57295823+marsavar@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:31:55 +0100 Subject: [PATCH] feat: pass properties for an image hosted in a private registry --- src/constructs/ecs/ecs-task.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/constructs/ecs/ecs-task.ts b/src/constructs/ecs/ecs-task.ts index 97ec8692c2..fa13fbdee8 100644 --- a/src/constructs/ecs/ecs-task.ts +++ b/src/constructs/ecs/ecs-task.ts @@ -3,6 +3,7 @@ import { Alarm, TreatMissingData } from "aws-cdk-lib/aws-cloudwatch"; import { SnsAction } from "aws-cdk-lib/aws-cloudwatch-actions"; import type { ISecurityGroup, IVpc } from "aws-cdk-lib/aws-ec2"; import type { IRepository } from "aws-cdk-lib/aws-ecr"; +import type { RepositoryImageProps } from "aws-cdk-lib/aws-ecs"; import { Cluster, Compatibility, @@ -53,6 +54,7 @@ export type RepositoryContainer = { export type RegistryContainer = { id?: string; + imageProps?: RepositoryImageProps; type: "registry"; }; @@ -122,7 +124,7 @@ const getContainer = (config: ContainerConfiguration) => { if (config.type == "repository") { return ContainerImage.fromEcrRepository(config.repository, config.version); } else { - return ContainerImage.fromRegistry(config.id ?? "ubuntu:focal"); + return ContainerImage.fromRegistry(config.id ?? "ubuntu:jammy", config.imageProps); } };