Cookbook Basics - AWS OpsWorks

Cookbook Basics

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.

You can use cookbooks to accomplish a wide variety of tasks. The following topics assume that you are new to Chef, and describe how to use cookbooks to accomplish some common tasks. Because Test Kitchen does not yet support Windows, the examples are all for Linux, with notes indicating how to adapt them for Windows. If you are new to Chef, we recommend going through these examples, even if you will be working with Windows. Most of the examples in this topic can be used on Windows instances with some modest changes, which are noted in the examples. All of the examples run in a virtual machine, so you don't even need to have a Linux computer. Just install Vagrant and Test Kitchen on your regular workstation.

Note

If you want to run these recipes on a Windows instance, the simplest approach is to create a Windows stack and run the recipes on one of the stack's instances. For more information on how to run recipes on an AWS OpsWorks Stacks Windows instance, see Running a Recipe on a Windows Instance.

Before continuing, make sure that you have installed Vagrant and Test Kitchen, and gone through their Getting Started walkthroughs. For more information, see Vagrant and Test Kitchen.