Skip to content

Instantly share code, notes, and snippets.

@hades2510
Created April 5, 2020 13:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hades2510/1c5d3ef078eb1e2076121f35b942691c to your computer and use it in GitHub Desktop.
IAM Policy Lambda SQS Triggered to start an ECS Task
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S1",
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::aws-acount-id:role/ecs-task-role"
},
{
"Sid": "S2",
"Effect": "Allow",
"Action": [
"sqs:ReceiveMessage",
"sqs:DeleteMessage",
"sqs:GetQueueAttributes",
"iam:PassRole",
"ecs:RunTask",
],
"Resource": [
"arn:aws:sqs:us-west-1:aws-acount-id:sqs-name",
"arn:aws:iam::aws-acount-id:role/ecsTaskExecutionRole",
"arn:aws:ecs:us-west-1:aws-acount-id:task-definition/ecs-task-definition"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment