Step 3: Run and Test the Recipe
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
In the service navigation pane, choose Stack. The MyCookbooksDemoStack page is displayed.
Choose Run Command. The Run Command page is displayed.
For Command, choose Execute Recipes.
For Recipes to execute, type
opsworks_cookbook_demois the name of the cookbook as defined in the
defaultis the name of the recipe to run, that is, the name of the
default.rbfile in the cookbook's
recipessubdirectory, without the file extension.
Leave the following default settings:
Advanced, Custom Chef JSON (blank)
Instances (Select all checked, MyCookbooksDemoLayer checked, cookbooks-demo1 checked)
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
With the Running command execute_recipes page displayed, for cookbooks-demo1, for Log, choose show. The execute_recipes log page is displayed.
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.