A developer is deploying a containerized Python application to Amazon ECS on AWS Fargate. The application needs to access an Amazon S3 bucket. During local development, the developer configured the AWS SDK (Boto3) by setting the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables in the local shell. In the ECS task definition, the developer assigned an IAM role with the correct permissions to the `taskRoleArn` parameter. However, when the container runs in Fargate, the application receives authorization errors because it tries to use the developer's local credentials, which have expired.
Which of the following actions should the developer take to resolve this issue and ensure the application securely accesses Amazon S3? (Select TWO.)
- Remove the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables from the task definition's container environment configuration.Cevap
- Configure the IAM role's trust policy to allow the `ecs-tasks.amazonaws.com` service principal to perform the `sts:AssumeRole` action.Cevap
- CAdd the required Amazon S3 read permissions to the ECS Task Execution Role (`executionRoleArn`) instead of the Task Role.
- DInclude a shared credentials file containing static credentials in the container image at the `~/.aws/credentials` path.
- EUpdate the container code to manually fetch temporary credentials from the EC2 Instance Metadata Service (IMDSv2) endpoint.