-
Notifications
You must be signed in to change notification settings - Fork 1
/
ec2-user-data.txt
executable file
·57 lines (44 loc) · 1.16 KB
/
ec2-user-data.txt
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# This is an EC2 user data script for bringing up an instance with
# Erlang 19.3 and Elixir 1.4.2.
#
# As with any user-data script, its progress can be observed by
# SSHing into the instance and tailing /var/log/cloud-init-output.log
#
# Enable verbose shell logging and abort on any error.
set -e -x -v
# The Erlang compilation will fail without this being set.
# Because this script runs on boot, there is no HOME env var set.
export HOME=/root
export PATH=$PATH:/usr/local/bin
function report_error {
echo "FINISHED WITH ERROR"
}
function finished {
if [ $? -eq 0 ]; then
echo "FINISHED SUCCESSFULLY"
fi
}
# Trap EXIT and ERR and log appropriate error messages.
trap report_error ERR
trap finished EXIT
yum -y update aws-cfn-bootstrap
yum -y install aws-cli
# erlang deps
yum -y groupinstall "Development Tools"
yum -y install ncurses-devel openssl-devel
cd /tmp
# Install Erlang
wget http://www.erlang.org/download/otp_src_19.3.tar.gz
tar -zxvf otp_src_19.3.tar.gz
cd otp_src_19.3/
./configure
make
make install
cd /tmp
# Install Elixir
wget https://github.com/elixir-lang/elixir/archive/v1.4.2.zip
unzip v1.4.2.zip
cd elixir-1.4.2/
make
make install