forked from hajowieland/terraform-k8s-the-real-hard-way-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
userdata-bastion.tpl
22 lines (22 loc) · 1.21 KB
/
userdata-bastion.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
sudo yum update
sudo yum upgrade -y
sudo yum install jq tmux -y
wget https://gist.githubusercontent.com/dmytro/3984680/raw/1e25a9766b2f21d7a8e901492bbf9db672e0c871/ssh-multi.sh -O /home/ec2-user/tmux-multi.sh
chmod +x /home/ec2-user/tmux-multi.sh
chown ec2-user:ec2-user /home/ec2-user/tmux-multi.sh
wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
chmod +x cfssl_linux-amd64
sudo mv cfssl_linux-amd64 /usr/local/bin/cfssl
sudo chown ec2-user:ec2-user /usr/local/bin/cfssl
wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
chmod +x cfssljson_linux-amd64
sudo mv cfssljson_linux-amd64 /usr/local/bin/cfssljson
sudo chown ec2-user:ec2-user /usr/local/bin/cfssljson
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv kubectl /usr/local/bin/kubectl
sudo chowon ec2-user:ec2-user /usr/local/bin/kubectl
sudo hostname "${component}.${domain}"
echo "AWS_DEFAULT_REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')" | sudo tee -a /etc/environment
echo "HOSTEDZONE_NAME=${domain}" | sudo tee -a /etc/environment