
Answer-first summary for fast verification
Answer: By defining them in the environment parameter of the task definition.
The correct answer is B. When using AWS Fargate with Amazon ECS, environment variables should be defined in the task definition. This is done using the environment parameter within the task definition, which allows you to specify environment variables for your containers. This ensures the variables are available to the application when it initializes. The service definition is not the appropriate place for this configuration, which makes options A and D incorrect. Option C is incorrect because the entryPoint parameter is used for specifying the entry point command for the container, not for defining environment variables.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
How should a developer pass environment variables to a container in an AWS Fargate application deployed with Amazon ECS?
A
By defining them in the environment parameter of the service definition.
B
By defining them in the environment parameter of the task definition.
C
By specifying them in the entryPoint parameter of the task definition.
D
By specifying them in the entryPoint parameter of the service definition.