'CDK: aws_cdk.aws_ecs.EcrImage vs aws_cdk.aws_ecs.ContainerImage

What is the difference between using aws_cdk.aws_ecs.EcrImage and aws_cdk.aws_ecs.ContainerImage to create instances using CDK?



Solution 1:[1]

Not much. ecs.EcrImage specifically represents an Amazon ECR Registry image. It extends ecs.ContainerImage construct, adding only an imageName property.

ContainerImage has static methods to return non-ECR (e.g. DockerHub) images. Perhaps confusingly, EcrImage inherits these factory methods as well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 fedonev