Step 3: Run and Test the Recipe - AWS OpsWorks

Step 3: Run and Test the Recipe

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.

Run and test the default recipe from within the cookbook that AWS OpsWorks Stacks copied to the instance. As you'll recall, this is the one-line recipe that displays a simple message in the log when the recipe runs.

To run the recipe
  1. In the service navigation pane, choose Stack. The MyCookbooksDemoStack page is displayed.

  2. Choose Run Command. The Run Command page is displayed.

  3. For Command, choose Execute Recipes.

  4. For Recipes to execute, type opsworks_cookbook_demo::default.

    opsworks_cookbook_demo is the name of the cookbook as defined in the metadata.rb file. default is the name of the recipe to run, that is, the name of the default.rb file in the cookbook's recipes subdirectory, without the file extension.

  5. Leave the following default settings:

    • Comment (blank)

    • Advanced, Custom Chef JSON (blank)

    • Instances (Select all checked, MyCookbooksDemoLayer checked, cookbooks-demo1 checked)

  6. Choose Execute Recipes. The Running command execute_recipes page is displayed. Do not proceed until Status changes to successful. This process might take a few minutes, so be patient.

To check the recipe's results
  1. With the Running command execute_recipes page displayed, for cookbooks-demo1, for Log, choose show. The execute_recipes log page is displayed.

  2. Scroll down the log and find an entry that looks similar to the following:

    [2015-11-13T19:14:39+00:00] INFO: ********** Hello, World! **********

You have successfully run your first recipe! In the next step, you will update your cookbook by adding a recipe that installs a package on the instance.