A developer is deploying a containerized application to Amazon ECS using the AWS Fargate launch type. The application requires a database connection string that is stored as a secure string in Systems Manager Parameter Store. The developer wants the connection string to be automatically injected as a container environment variable at startup without modifying the application code to retrieve it. Which configuration will meet these requirements?
- Reference the Parameter Store parameter ARN in the `secrets` section of the task's container definition, and assign an IAM role with `ssm:GetParameters` permissions to the ECS Task Execution Role.Cevap
- BReference the Parameter Store parameter ARN in the `secrets` section of the task's container definition, and assign an IAM role with `ssm:GetParameters` permissions to the ECS Task Role.
- CRetrieve the connection string from Systems Manager Parameter Store at runtime by hardcoding an IAM user's Access Key ID and Secret Access Key in the application's configuration code inside the container.
- DReference the Parameter Store parameter ARN in the `secrets` section of the task's container definition, assign `ssm:GetParameters` permissions to the ECS Task Execution Role, and set the role's trust policy to trust `ec2.amazonaws.com` to assume the role.
Cevap
Reference the Parameter Store parameter ARN in the `secrets` section of the task's container definition, and assign an IAM role with `ssm:GetParameters` permissions to the ECS Task Execution Role.
Referencing the Systems Manager Parameter Store parameter ARN in the `secrets` section of the container definition tells the ECS agent to retrieve the parameter and inject it as an environment variable at container startup. Because this action is performed by the ECS container agent before the containerized application is running, the ECS Task Execution Role must contain the `ssm:GetParameters` permission.
Adım Adım Çözüm
Anahtar Kavram
Delineation between ECS Task Role and ECS Task Execution Role for secret management
Tahmini Süre:1m 30s