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

Step 6: Deploy the App to the Instance

Important

The AWS OpsWorks Stacks service reached end of life on May 26, 2024 and has been disabled for both new and existing customers. We strongly recommend customers migrate their workloads to other solutions as soon as possible. If you have questions about migration, reach out to the AWS Support Team on AWS re:Post or through AWS Premium Support.

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:

    Layer interface showing MyLinuxDemoLayer with tabs for Settings, Recipes, Network, EBS Volumes, and Security.

    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:

    Custom Chef Recipes configuration panel with Repository URL and lifecycle stages for a Linux demo layer.

  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:

    Apps table showing MyLinuxDemoApp with deploy, edit, and delete options.

  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:

    Deploy App interface with settings for MyLinuxDemoApp, including command and instance selection.

  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:

    Deployment details for MyLinuxDemoApp showing successful status and duration of 1 minute 13 seconds.

You have now successfully deployed the app to the instance.

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