Deploying an Application with AWS OpsWorks

Hands-On Lab

 

Photo of Craig Arcuri

Craig Arcuri

AWS Training Architect II in Content

Length

00:30:00

Difficulty

Intermediate

OpsWorks is a Configuration Management and Deployment tool which shares some similarities to CloudFormation and Elastic Beanstalk. It sits between the two in terms of having the most control (CloudFormaion), and ease of use (Elastic Beanstalk). The foundational element of OpsWorks is the OpsWorks Stack. From the stack, you can build Layers, and in Layers you can deploy instances. On the Instances you deploy applications. This Learning Activity will walk the student through the fundamental steps of building an OpsWorks Stack and all of its elements. The end result will be a small web application deployed on an instance in the stack.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Deploying an Application with AWS OpsWorks

Introduction

In this hands-on lab, we'll go through the fundamental steps of building an OpsWorks Stack and all of its elements. The end result will be a small web application deployed on an instance in the stack.

Log in to the AWS environment by using the cloud_user credentials provided on the lab page. Once inside the AWS account, make sure you are using us-east-1 (N. Virginia) as the selected region.

Deploying an Application with OpsWorks

Create One OpsWorks Stack

  1. Navigate to OpsWorks.
  2. Click Go to OpsWorks Stacks.
  3. Click Add your first stack.
  4. Select Chef 11 stack.
  5. Give it a Stack name (e.g., "OpsWorksLearningActivity").
  6. Select the provided VPC.
  7. Click Add stack.

Create a Layer

  1. Click Add a layer.
  2. For Layer type, select PHP App Server.
  3. For Elastic Load Balancer, select the provided one.
  4. For Instance Shutdown Behavior, select Wait for an instance's connections to drain from the load balancer before shutting it down.
  5. Click Add layer.
  6. Click to open our PHP App Server layer.
  7. Click Network.
  8. Set Public IP addresses to Yes.
  9. Click Save.

Add Instance to App Layer

  1. In the PHP App Server section, click Add instance.
  2. In the New tab, change the Size to t2.micro.
  3. Click Add Instance.
  4. Under Actions, click start.

Add Application to Instance

  1. Click Apps in the sidebar.
  2. Give it a Name of "phpSample".
  3. Enter the Repository URL of <a href="https://github.com/pinehead/opsworks-sysops.git&quot; target="_blank">https://github.com/pinehead/opsworks-sysops.git&lt;/a&gt;
  4. Click Add App.
  5. In the Apps section, under Actions, click deploy.
  6. On the Deploy App page, click Deploy.

Verify Instance Deployed Properly

  1. Click Instances in sidebar.
  2. Click the instance we created.
  3. In the Network and Security section, open the public IP address in a browser tab to verify the app successfully deployed.

Conclusion

Congratulations on completing this lab!