728x90
반응형
stepfunction 에서 ecs 실행 시키려면 역할머신에 권한을 줘야한다.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecs:RunTask"
],
"Resource": [
*
]
},
{
"Effect": "Allow",
"Action": [
"ecs:StopTask",
"ecs:DescribeTasks"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"events:PutTargets",
"events:PutRule",
"events:DescribeRule"
],
"Resource": [
"arn:aws:events:{region}:{account id}:rule/StepFunctionsGetEventsForECSTaskRule"
]
},
{
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": [
"arn:aws:iam::{account id}:role/ecsTaskExecutionRole"
]
}
]
}
{
"Comment": "ecs",
"StartAt": "ecs",
"States": {
"ecs": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"CapacityProviderStrategy": [
{
"CapacityProvider": "FARGATE_SPOT"
}
],
"Cluster": "{cluster name}",
"TaskDefinition": "{task-definition arn}",
"Overrides": {
"ContainerOverrides": []
},
"NetworkConfiguration": {
"AwsvpcConfiguration": {
"Subnets": [],
"SecurityGroups": [],
"AssignPublicIp": "ENABLED"
}
}
},
"Next": "wait",
"ResultPath": "$.result"
},
...
728x90
반응형
'개발 > AWS' 카테고리의 다른 글
AWS-EC2에 gitlab 띄우기 (0) | 2022.07.18 |
---|---|
AWS aws-vault (0) | 2022.05.20 |
AWS Lambda SQS Trigger (0) | 2022.05.19 |
AWS DMS VPC 보조 CIDR (0) | 2022.05.19 |
AWS Lambda serverless v3 version up (0) | 2022.05.12 |