forked from theonestack/hl-component-ecs-runtask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-runtask.config.yaml
67 lines (63 loc) · 1.44 KB
/
ecs-runtask.config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
task_type: FARGATE
network_mode: awsvpc
cpu: 256
memory: 512
step_function_iam_policies:
run_task:
action:
- ecs:RunTask
- iam:PassRole
manage_task:
action:
- ecs:StopTask
- ecs:DescribeTasks
task_events:
action:
- events:PutTargets
- events:PutRule
- events:DescribeRule
resource:
- Fn::Sub: arn:aws:events:${AWS::Region}:${AWS::AccountId}:rule/StepFunctionsGetEventsForECSTaskRule
scheduler_iam_policies:
event_schedule:
action:
- states:StartExecution
resource:
- Fn::Sub: ${StateMachine}
state_machine: |
{
"Comment": "",
"StartAt": "Run Task",
"TimeoutSeconds": 3600,
"States": {
"Run Task": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"LaunchType": "FARGATE",
"Cluster": "${EcsCluster}",
"TaskDefinition": "${Task}",
"NetworkConfiguration": {
"AwsvpcConfiguration": {
"Subnets": ["${SubnetId}"],
"SecurityGroups": ["${SecurityGroup}"],
"AssignPublicIp": "DISABLED"
}
}
},
"Next": "Success",
"Catch": [
{
"ErrorEquals": [ "States.ALL" ],
"Next": "Failure"
}
]
},
"Success": {
"Type": "Succeed"
},
"Failure": {
"Type": "Fail"
}
}
}