This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
forked from adhorn/chaos-ssm-documents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment_run_SSM_cpuburn.json
77 lines (77 loc) · 2.63 KB
/
experiment_run_SSM_cpuburn.json
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
68
69
70
71
72
73
74
75
76
77
{
"version": "1.0.0",
"title": "Running a CPU burn on EC2 instances using SSM Run Command",
"description": "Running a CPU burn on EC2 instances using SSM Run Command",
"tags": ["cpu"],
"configuration": {
"endpoint_url": {
"type": "env",
"key": "ENDPOINT_URL"
},
"instance_id": {
"type": "env",
"key": "INSTANCE_ID"
},
"duration": "30",
"cpu": "0"
},
"contributions": {
"reliability": "medium",
"security": "none",
"scalability": "medium"
},
"steady-state-hypothesis": {
"title": "Application responds within 6 seconds",
"probes": [
{
"name": "http-response-time",
"type": "probe",
"provider": {
"type": "python",
"module": "chaoscloud.probes.http",
"func": "time_http_call",
"arguments": {
"url": "${endpoint_url}"
}
},
"tolerance": {
"name": "http-response-time-under",
"type": "probe",
"provider": {
"type": "python",
"module": "chaoscloud.tolerances.http",
"func": "response_time_under",
"arguments": {
"duration": 6000
}
}
}
}
]
},
"method": [
{
"type": "action",
"name": "inject-cpu",
"provider": {
"type": "process",
"path": "aws",
"arguments": "ssm send-command --document-name \"cpu-stress\" --document-version \"1\" --targets '[{\"Key\":\"InstanceIds\",\"Values\":[\"${instance_id}\"]}]' --parameters '{\"duration\":[\"${duration}\"],\"cpu\":[\"${cpu}\"]}' --timeout-seconds 60 --max-concurrency \"50\" --max-errors \"0\" --output-s3-bucket-name \"adhorn-chaos-ssm-output\" --cloud-watch-output-config '{\"CloudWatchOutputEnabled\":true}' --region eu-west-1 --query 'Command.CommandId' --output text > CommandId.info"
}
}
],
"rollbacks": [
{
"type": "action",
"name": "Stop SSM run command",
"provider": {
"type": "process",
"path": "aws",
"arguments": "ssm cancel-command --command-id $(cat CommandId.info) "
},
"pauses": {
"after": 30
}
}
]
}