Amazon ECR Image Repository: Pulling Images for Amazon ECS Task | Exam DVA-C01

Pulling Images from Amazon ECR for Amazon ECS Task

Prev Question Next Question

Question

As a cloud engineer, you have been granted access to an Amazon ECR image repository.

You have to pull images from the repository as a part of a container definition when creating an Amazon ECS task.

What statement correctly describes this scenario?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: C.

You can access the Amazon ECR image repository with Amazon EC2 or AWS Fargate launch types.

Incorrect Answers:

Options A, B are incorrect because you can access the Amazon ECR image repository with Amazon EC2 or AWS Fargate launch types.

Option D is incorrect because it does not make sense as a recursive statement.

The right statement is that for AWS Fargate launch types, you must grant your Amazon ECS task execution role permission to access the Amazon ECR image repository.

References:

https://go.aws/2WZNtBj

The correct answer is C. You can access the Amazon ECR image repository with Amazon EC2 or AWS Fargate launch types.

Explanation: Amazon Elastic Container Registry (Amazon ECR) is a fully-managed container registry that makes it easy for developers to store, manage, and deploy Docker container images. Amazon ECR can be used to host and manage Docker images that are used in Amazon Elastic Container Service (Amazon ECS) tasks.

Amazon ECS is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster. Amazon ECS can be launched with two different launch types - Amazon EC2 and AWS Fargate. With Amazon EC2 launch type, you have to provide and manage the underlying infrastructure that runs your containerized applications. With AWS Fargate launch type, you do not have to manage the underlying infrastructure, and you can run your containers on serverless compute.

When creating an Amazon ECS task definition, you specify the container image to use and the location of the image. If the image is stored in an Amazon ECR repository, you can pull the image as part of the container definition. This can be done with both the Amazon EC2 and AWS Fargate launch types.

Therefore, the correct answer is C. You can access the Amazon ECR image repository with Amazon EC2 or AWS Fargate launch types. However, you must ensure that your task execution role has permission to access the Amazon ECR repository. This can be done by granting the necessary permissions to the task execution role, as mentioned in option D.