Deployment using AWS Management Console

Here, we will focus on deploying the AWS compute service as we did previously. Deploying AWS instances using the AWS Management Console is fairly simple. Follow the steps below:

  1. Log in into your AWS Management Console at https://console.aws.amazon.com or use your IAM user account to log in . We created an IAM user account in Chapter 2, Deploying Your First Web Application at https://AWS-account-ID-or-alias.signin.aws.amazon.com/console.
  2. Select the Services tab, followed by EC2 from the Compute section, and click on the Launch Instance button.
  3. On the next screen, search for and select Amazon Machine Image (AMI). In this book, we are using ami-cfe4b2b0, which is Amazon Linux AMI.
  4. Select the t2.micro type from the Choose an Instance Type step and click on the Next: Configure Instance Details button.
  5. Accept the default settings and click the Next: Add Storage button.
  6. Again, accept the default setting for storage and click on the Next: Add tags button followed by the Next: Configure Security Group button.
  1. Here, select the security group you created in Chapter 2, Deploying Your First Web Application, which in my case is sg-01864b4c, as shown in the following screenshot:

  1. Now, click on the Review and Launch button. Ignore any warnings that appear and press the Launch button.
  2. Select the key-pair, which in my case is EffectiveDevOpsAWS. Click the Launch Instances button.

Within a few minutes, your AWS instance will be up and running. Once the server is up, log in to the server from your local instance, which is CentOS in my case. Proceed with the following process to deploy the Hello World application manually and verify it locally or from the browser:

$ ssh -i ~/.ssh/EffectiveDevOpsAWS.pem [email protected] (replace this IP with your AWS public IP)
$ sudo yum install --enablerepo=epel -y nodejs
$ sudo wget https://raw.githubusercontent.com/yogeshraheja/Effective-DevOps-with-AWS/master/Chapter02/helloworld.js -O /home/ec2-user/helloworld.js
$ sudo wget https://raw.githubusercontent.com/yogeshraheja/Effective-DevOps-with-AWS/master/Chapter02/helloworld.conf -O /etc/init/helloworld.conf
$ sudo start helloworld

$ curl http://34.201.116.2:3000/

Hello World
Remember to terminate the instance from the AWS Management Console once you are done with the test.

The termination process is also very straightforward. Select the created instance, click the Actions drop-down, followed by the Instance State option and then click Terminate, as shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.238.151