Skip to content

Commit

Permalink
Merge pull request #19 from davinerd/tags-support
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy authored Dec 3, 2017
2 parents bfab6d2 + 9e76187 commit f981e5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Chaosfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
"enableForASGs": [
],
"disableForASGs": [
],
"enableForTags": [
{
"key": "chaos_monkey",
"value": "true"
}
]
}
10 changes: 9 additions & 1 deletion lambda/index.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ ec2.describeInstances(function(err, data) {
}
}
}
} else {
if (llamaConfig.enableForTags) {
llamaConfig.enableForTags.forEach(function(asgTags) {
if (asgTags.key == tag.Key && asgTags.value == tag.Value) {
candidates.push(inst);
}
});
}
}
});
});
Expand Down Expand Up @@ -78,4 +86,4 @@ ec2.describeInstances(function(err, data) {
function randomIntFromInterval(min,max)
{
return Math.floor(Math.random()*(max-min+1)+min);
}
}

0 comments on commit f981e5e

Please sign in to comment.