Getting Started with Cookbooks in AWS OpsWorks Stacks - AWS OpsWorks

Getting Started with Cookbooks in AWS OpsWorks Stacks

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.

A production-level AWS OpsWorks Stacks stack typically requires some customization, which often means implementing a custom Chef cookbook. A cookbook is a package file that contains configuration information, including instructions called recipes. A recipe is a set of one or more instructions, written with Ruby language syntax, that specifies the resources to use and the order in which those resources are applied. A resource, as used in Chef, is a statement of configuration policy. This walkthrough provides a basic introduction to implementing Chef cookbooks for AWS OpsWorks Stacks. To learn more about Chef, cookbooks, recipes, and resources, see the links in Next Steps.

This walkthrough mostly describes how to create your own cookbooks. You can also use community-provided cookbooks available on websites like the Chef Supermarket. To help you get started with community cookbooks, we include instructions for using a community cookbook from the Chef Supermarket later in the walkthrough.

Before you start this walkthrough, complete a few setup steps. If you have already completed any of the other walkthroughs in this chapter, such as Getting Started: Sample, then you have met the prerequisites for this walkthrough and can skip to start this walkthrough. Otherwise, be sure to complete the prerequisites, and then return to this walkthrough.