Skip to content

Instantly share code, notes, and snippets.

@kennyjwilli
Created December 11, 2018 23:13
Show Gist options
  • Save kennyjwilli/efeaf5ae4ac4b16dc8e6bf8acb90cdbb to your computer and use it in GitHub Desktop.
Save kennyjwilli/efeaf5ae4ac4b16dc8e6bf8acb90cdbb to your computer and use it in GitHub Desktop.
#!/bin/bash
apt-get -y update
apt-get -y install ruby wget openjdk-8-jdk
cd /home/ubuntu
wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install
chmod +x ./install
./install auto
let ec2LaunchTemplate = new aws.ec2.LaunchTemplate("fib-ec2-launch-template", {
// Ubuntu Server 18.04 LTS
imageId: "ami-0bbe6b35405ecebdb",
instanceType: "t2.small",
vpcSecurityGroupIds: [fibSG.id],
monitoring: {
enabled: true
},
keyName: "kenny_test",
iamInstanceProfile: {
arn: ec2InstanceProfile.arn
},
userData: base64Encode(fs.readFileSync("ec2_codedeploy_userdata.txt", {encoding: "utf8"})),
blockDeviceMappings: [{
deviceName: "/dev/sda1",
ebs: {
volumeSize: 8,
volumeType: "gp2",
deleteOnTermination: "true"
}
}]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment