forked from anupam-ncsu/JenkinsECS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ECSAMI.sh
29 lines (22 loc) · 824 Bytes
/
ECSAMI.sh
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
#!/bin/bash -ex
sudo su -
yum update -y
#Install wget
yum install wget -y
# Install Cloudwatch agent
wget https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm
sudo rpm -U ./amazon-cloudwatch-agent.rpm
# copy the Jenkinscloudwatch json file to log to cloudwatch
vi /opt/aws/amazon-cloudwatch-agent/bin/webserver-config.json
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/webserver-config.json -s
#Install AWS CLI
cd ~
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
export PATH=~/.local/bin:$PATH
source ~/.bash_profile
pip --version
pip install awscli --upgrade --user
pip install awscli --upgrade --user
which aws
ln -s /root/.local/bin/aws /usr/bin