forked from adhorn/chaos-ssm-documents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blackhole-dynamo-stress.yml
25 lines (25 loc) · 990 Bytes
/
blackhole-dynamo-stress.yml
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
---
schemaVersion: '2.2'
description: Block access to dynamo on an instance
parameters:
duration:
type: String
description: The duration - in seconds - of the attack. (Required)
default: "60"
mainSteps:
- action: aws:runShellScript
name: ChaosBlackholeDynamoAttack
inputs:
runCommand:
# Block some Amazon DynamoDB API endpoints, add yours :)
# make copy of /etc/hosts to /etc/host.back
- sudo cp /etc/hosts /etc/hosts.back
- echo "127.0.0.1 dynamodb.us-east-1.amazonaws.com" >> /etc/hosts
- echo "127.0.0.1 dynamodb.us-east-2.amazonaws.com" >> /etc/hosts
- echo "127.0.0.1 dynamodb.us-west-1.amazonaws.com" >> /etc/hosts
- echo "127.0.0.1 dynamodb.us-west-2.amazonaws.com" >> /etc/hosts
- echo "127.0.0.1 dynamodb.eu-west-1.amazonaws.com" >> /etc/hosts
- echo "127.0.0.1 dynamodb.eu-north-1.amazonaws.com" >> /etc/hosts
- sleep {{ duration }}
# copy back the old version /etc/hosts
- sudo cp /etc/hosts.back /etc/hosts