February 2020
Intermediate to advanced
440 pages
13h 51m
English
We need to create two EC2 instances to complete this recipe. We can do this by following the Using EC2 user data to launch an instance with a web server recipe in Chapter 6, Working with EC2 Instances, but using the following EC2 user data commands:
#!/bin/bashsudo suyum update -yyum install -y httpd systemctl start httpd.service systemctl enable httpd.servicecd /var/www/htmlecho "<html><h1>My Web Server 1</h1></html>" > index.html
Replace My Web Server 1 with My Web Server 2 for the second instance.
Add Name tags (tags with Key as Name) for the instances to identify them from the instances list. For the first instance, set Value to WebServer1. For the second instance, set Value to WebServer2.
Before proceeding, make sure that ...
Read now
Unlock full access