1. Go to AWS IAM console.
2. In the left sidebar,
3. In Policy editor section,
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:DescribeSecret",
"secretsmanager:GetSecretValue"
],
"Resource": "arn:aws:secretsmanager:us-east-1:<YOUR-AWS-ACCOUNT-ID>:secret:*"
}
]
}
4. Scroll down to the bottom. Click Next.
5. In Policy details section, enter ecsTaskRolePolicy
for Policy name.
6. Scroll down to the bottom, click Create policy.
7. Back to AWS IAM console.
8. In the left sidebar,
9. In Trusted entity type section, choose Custom trust policy.
10. In Custom trust policy section, fill out the following policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ecs-tasks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
11. Scroll down to the bottom, click Next.
12. In the Permissions policies section,
ecsTaskRolePolicy
.13. In Role details section, enter ecsTaskRole
for Role name.
14. Scroll down to the bottom. Click Create role.