Assigning a Registered Instance to a Layer - AWS OpsWorks

Assigning a Registered Instance to a Layer

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.

Note

This feature is supported only for Linux stacks.

After you register an instance, you can assign it to one or more layers. The advantage of assigning an instance to a layer instead of leaving it unassigned is that you can assign custom recipes to the layer's lifecycle events. AWS OpsWorks Stacks then runs them automatically at the appropriate time, after the layer's recipes for that event.

  • You can assign any registered instance to a custom layer. A custom layer has a minimal set of recipes that do not install any packages, so they should not create any conflicts with the instance's existing configuration.

  • You can assign on-premises instances to AWS OpsWorks Stacks built-in layers.

    Every built-in layer includes recipes that automatically install one or more packages. For example, the Java App Server Setup recipes install Apache and Tomcat. The layer's recipes might also perform other operations such as restarting services and deploying applications. Before assigning an on-premises instance to a built-in layer, you should ensure that the layer's recipes do not create any conflicts, such as attempting to install a different application server version than is currently on the instance. For more information, see Layers and AWS OpsWorks Stacks Layer Reference.

To assign a registered instance to a layer
  1. Add the layers that you want to use to the stack, if you have not done so already.

  2. Choose Instances in the navigation pane and then choose assign in the instance's Actions column.

  3. Select the appropriate layers and choose Save.

When you assign an instance to a layer AWS OpsWorks Stacks does the following.

  • Runs the layer's Setup recipes.

  • Adds any attached Elastic IP addresses or Amazon EBS volumes to the stack's resources.

    You can then use AWS OpsWorks Stacks to manage these resources. For more information, see Resource Management.

After they are finished, the instance is in the online status and fully incorporated into the stack. AWS OpsWorks Stacks then runs the layer's assigned recipes each time a lifecycle event occurs.