Reader small image

You're reading from  AWS Certified Solutions Architect ??? Associate Guide

Product typeBook
Published inOct 2018
PublisherPackt
ISBN-139781789130669
Edition1st Edition
Tools
Right arrow
Authors (2):
Gabriel Ramirez
Gabriel Ramirez
author image
Gabriel Ramirez

Gabriel Ramirez is a passionate technologist with a broad experience in the Software Industry, he currently works as an Authorized Trainer for Amazon Web Services and Google Cloud. He is holder of 9/9 AWS Certifications and does community work by organizing the AWS User Groups in Mexico.
Read more about Gabriel Ramirez

Stuart Scott
Stuart Scott
author image
Stuart Scott

Stuart Scott is the AWS content lead at Cloud Academy where he has created over 40 courses reaching tens of thousands of students. His content focuses heavily on cloud security and compliance, specifically on how to implement and configure AWS services to protect, monitor and secure customer data in an AWS environment. He has written numerous cloud security blogs Cloud Academy and other AWS advanced technology partners. He has taken part in a series of cloud security webinars to share his knowledge and experience within the industry to help those looking to implement a secure and trusted environment. In January 2016 Stuart was awarded 'Expert of the Year' from Experts Exchange for his knowledge share within cloud services to the community.
Read more about Stuart Scott

View More author details
Right arrow

Resiliency

To build resilience, let's shut down and start up the web server to make sure that MySQL and Apache automatically start with the operating system. We first define the CURRENT_INSTANCE variable to make our commands easier, as follows:

CURRENT_INSTANCE=$(aws ec2 describe-instances --query 'Reservations[*].Instances[*].InstanceId' --filter 'Name=tag:Name,Values=WebServer' --output text)

aws ec2 reboot-instances --instance-ids $CURRENT_INSTANCE

Again, check phpinfo.php, to verify that it is still working. Now, issue a stop instance command, wait a few seconds, and start the instance again, as follows:

aws ec2 stop-instances --instance-id $CURRENT_INSTANCE
aws ec2 start-instances --instance-id $CURRENT_INSTANCE

If you try to reach the informational web page, 54.172.31.74/phpinfo.php, it will probably no longer be there. Why did this happen? Every time...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
AWS Certified Solutions Architect ??? Associate Guide
Published in: Oct 2018Publisher: PacktISBN-13: 9781789130669

Authors (2)

author image
Gabriel Ramirez

Gabriel Ramirez is a passionate technologist with a broad experience in the Software Industry, he currently works as an Authorized Trainer for Amazon Web Services and Google Cloud. He is holder of 9/9 AWS Certifications and does community work by organizing the AWS User Groups in Mexico.
Read more about Gabriel Ramirez

author image
Stuart Scott

Stuart Scott is the AWS content lead at Cloud Academy where he has created over 40 courses reaching tens of thousands of students. His content focuses heavily on cloud security and compliance, specifically on how to implement and configure AWS services to protect, monitor and secure customer data in an AWS environment. He has written numerous cloud security blogs Cloud Academy and other AWS advanced technology partners. He has taken part in a series of cloud security webinars to share his knowledge and experience within the industry to help those looking to implement a secure and trusted environment. In January 2016 Stuart was awarded 'Expert of the Year' from Experts Exchange for his knowledge share within cloud services to the community.
Read more about Stuart Scott