Читать книгу AWS Certified Solutions Architect Study Guide - Ben Piper, David Higby Clinton - Страница 81

EXERCISE 2.5 Create a Launch Template

Оглавление

In this exercise, you'll create a launch template that installs and configures a simple web server. You'll then use the launch template to manually create an instance.

1 In the EC2 Dashboard, click Launch Templates.

2 Click the Create Launch Template button.

3 Give the launch template a name such as MyTemplate.

4 Click the Search For AMI link to locate one of the Ubuntu Server LTS AMIs (make sure the AMI you choose uses the 64‐bit x86 architecture and not 64‐bit ARM).

5 For Instance Type, select t2.micro.

6 Under Security Groups, select a security group that allows inbound HTTP access. Create a new security group if necessary.

7 Expand the Advanced Details section and enter the following in the User Data field: #!/bin/bash apt-get update apt-get install -y apache2 echo "Welcome to my website"> index.html cp index.html /var/www/html

8 Click the Create Launch Template button.

9 Click the Launch Instance From This Template link.

10 Under Source Template Version, select 1 (Default).

11 Click the Launch Instance From Template button.

12 After the instance boots, browse to its public IP address. You should see a web page that says “Welcome to my website.”

13 Terminate the instance when you're done with it.

AWS Certified Solutions Architect Study Guide

Подняться наверх