Custom AWS OpsWorks Stacks Layers - AWS OpsWorks

Custom AWS OpsWorks Stacks Layers

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 custom layer has only a minimal set of recipes. You then add appropriate functionality to the layer by implementing custom recipes and assigning them to the layer's lifecycle events.

The custom layer has the following configuration settings.

Note

AWS OpsWorks Stacks automatically installs Ruby on the layer's instances. If you want to run Ruby code on the instance but don't want to use the default Ruby version, you can use custom JSON or a custom attributes file to specify your preferred version. For more information, see Ruby Versions.

The basic procedure for creating a custom layer has the following steps:

  1. Implement a cookbook that contains the recipes and associated files required to install and configure packages, handle configuration changes, deploy apps, and so on.

    Depending on your requirements, you might also need recipes to handle undeployment and shutdown tasks. For more information, see Cookbooks and Recipes.

  2. Create a custom layer.

  3. Assign your recipes to the appropriate lifecycle events.

You then add instances to the layer, start them, and deploy apps to those instances.

Important

To deploy apps to a custom layer's instances, you must implement recipes to handle the deploy operation and assign them to the layer's Deploy event.