Skip to content

Instantly share code, notes, and snippets.

@isweluiz
Last active April 17, 2021 19:24
Show Gist options
  • Save isweluiz/a91bf6fc4123cf3b77741736f9c500a9 to your computer and use it in GitHub Desktop.
Save isweluiz/a91bf6fc4123cf3b77741736f9c500a9 to your computer and use it in GitHub Desktop.
Launch

Launch instance templates + tomcat 9

You can create a launch template that contains the configuration information to launch an instance. Launch templates enable you to store launch parameters so that you do not have to specify them every time you launch an instance. For example, a launch template can contain the AMI ID, instance type, and network settings that you typically use to launch instances. When you launch an instance using the Amazon EC2 console, an AWS SDK, or a command line tool, you can specify the launch template to use.

The following diagram shows a launch template with three versions.

official

For each launch template, you can create one or more numbered launch template versions. Each version can have different launch parameters. When you launch an instance from a launch template, you can use any version of the launch template. If you do not specify a version, the default version is used. You can set any version of the launch template as the default version—by default, it's the first version of the launch template.

Create launch template

Imgur img 3 4

#!/bin/bash
yum install wget -y 
yum install java-1.8.0-openjdk.x86_64 -y 
wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.45/bin/apache-tomcat-9.0.45.tar.gz -O /opt/apache-tomcat-9.0.45.tar.gz
cd /opt && tar -xvf apache-tomcat-9.0.45.tar.gz
ln -s /opt/apache-tomcat-9.0.45 /opt/tomcat
sudo /opt/tomcat/bin/startup.sh &

img

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment