Step 6: Deploy the App to the Instance - AWS OpsWorks

Step 6: Deploy the App to the Instance

Important

AWS OpsWorks Stacks is no longer accepting new customers. Existing customers will be able to use the OpsWorks console, API, CLI, and CloudFormation resources as normal until May 26, 2024, at which time they will be discontinued. To prepare for this transition, we recommend you transition your stacks to AWS Systems Manager as soon as possible. For more information, see AWS OpsWorks Stacks End of Life FAQs and Migrating your AWS OpsWorks Stacks applications to AWS Systems Manager Application Manager.

In this step, you will deploy the app from GitHub to the running instance. (For more information, see Deploying Apps.) Before you deploy the app, you must specify the recipe to use to coordinate the deployment. A recipe is a Chef concept. Recipes are instructions, written with Ruby language syntax, that specify the resources to use and the order in which those resources are applied. (For more information, go to About Recipes on the Learn Chef website.)

To specify the recipe to use to deploy the app to the instance
  1. In the service navigation pane, choose Layers. The Layers page is displayed.

  2. For MyLinuxDemoLayer, choose Recipes:

    The Layer MyLinuxDemoLayer page is displayed with the Recipes tab open.

  3. For Custom Chef Recipes, for Deploy, type nodejs_demo::default, and then press Enter. nodejs_demo is the name of the cookbook and default is the name of the target recipe within the cookbook. (To explore the recipe's code, see Learning More: Explore the Cookbook Used in This Walkthrough.) Your results must match the following screenshot:

  4. Choose Save. AWS OpsWorks Stacks adds the recipe to the layer's Deploy lifecycle event.

To deploy the app to the instance
  1. In the service navigation pane, choose Apps. The Apps page displays.

  2. For MyLinuxDemoApp, for Actions, choose deploy, as displayed in the following screen shot:

  3. On the Deploy App page, leave the defaults for the following:

    • Command (Deploy)

    • Comment (blank)

    • Settings, Advanced, Custom Chef JSON (blank)

    • Instances, Advanced (checked Select all, checked MyLinuxDemoLayer, checked demo1)

  4. Your results must match the following screenshot:

  5. Choose Deploy. The Deployment MyLinuxDemoApp – deploy page is displayed. Status changes from running to successful. A spinning circle displays next to demo1, which then changes to a green check mark. Note that this process can take several minutes. Do not proceed until you see both a Status of successful and the green check mark icon.

  6. Your results must match the following screenshot except of course for Created at, Completed at, Duration, and User. If status is failed, then to troubleshoot, for Log, choose show to get details about the failure:

You have now successfully deployed the app to the instance.

In the next step, you will test the deployed app on the instance.