Skip to content

Commit

Permalink
support sysdig
Browse files Browse the repository at this point in the history
  • Loading branch information
roylines committed Jun 20, 2016
1 parent acc2b24 commit 872b5c8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ resource "template_file" "user_data" {
newrelic_license_key = "${var.newrelic_license_key}"
ruxit_account = "${var.ruxit_account}"
ruxit_token = "${var.ruxit_token}"
sysdig_access_key = "${var.sysdig_access_key}"
}
}

Expand Down
14 changes: 13 additions & 1 deletion user-data.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

yum install -y aws-cli awslogs jq wget kernel-devel-$(uname -r)
yum install -y aws-cli awslogs jq wget

# copy configurations
aws s3 cp s3://${bucket_id}/ecs.config /etc/ecs/ecs.config
Expand Down Expand Up @@ -43,3 +43,15 @@ else
./ruxit-agent-install.sh
popd
fi

# configure and start sysdig monitoring (docker version not available in ECS)
if [ "${sysdig_access_key}" = "none" ]; then
echo "no sysdig key set, skipping"
else
echo "configuring sysdig"
pushd /usr/local/src
wget -O sysdig-agent-install.sh https://s3.amazonaws.com/download.draios.com/stable/install-agent
chmod u+x ./sysdig-agent-install.sh
./sysdig-agent-install.sh --access_key ${sysdig_access_key} --tags "instanceid:$instanceId"
popd
fi
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ variable "ruxit_token" {
default = "none"
}

variable "sysdig_access_key" {
description = "the sysdig access key (only needed for sysdig support)"
default = "none"
}

variable "ssh_public_key" {
description = "public key to allow ssh to cluster instances"
}

0 comments on commit 872b5c8

Please sign in to comment.