Sha256: 124dbddae4f658b04387cc912960546cbf1161101d093cd45f0d1ab15f4a09a9

Contents?: true

Size: 748 Bytes

Versions: 3

Compression:

Stored size: 748 Bytes

Contents

#!/bin/bash -eux

# https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html

REGION=$(curl -s 169.254.169.254/latest/meta-data/placement/availability-zone | sed s'/.$//')

type python || apt-get install -y python-pip

# Install awslogs and the jq JSON parser
curl -s https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -O

# in order to install awslogs non-interactively we need a filler configfile
mkdir -p /etc/awslogs
cat > /etc/awslogs/awslogs.conf <<- EOL
[general]
state_file = /var/awslogs/state/agent-state
## filler config file, will get replaced by configure.sh script
EOL

python ./awslogs-agent-setup.py --region "$REGION" --non-interactive --configfile=/etc/awslogs/awslogs.conf

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws-ec2-1.4.4 lib/aws_ec2/scripts/cloudwatch/install/ubuntu.sh
aws-ec2-1.4.3 lib/aws_ec2/scripts/cloudwatch/install/ubuntu.sh
aws-ec2-1.4.2 lib/aws_ec2/scripts/cloudwatch/install/ubuntu.sh