Using AWS OpsWorks Stacks with Other AWS Services - AWS OpsWorks

Using AWS OpsWorks Stacks with Other AWS Services

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 have application servers running in an AWS OpsWorks Stacks stack use a variety of AWS services that are not directly integrated with AWS OpsWorks Stacks. For example, you can have your application servers use Amazon RDS as a back-end database. You can access such services by using the following general pattern:

  1. Create and configure the AWS service by using the AWS console, API, or CLI and record any required configuration data that the application will need to access the service, such as host name or port.

  2. Create one or more custom recipes to configure the application so that it can access the service.

    The recipe obtains the configuration data from stack configuration and deployment JSON attributes that you define with custom JSON prior to running the recipes.

  3. Assign the custom recipe to the Deploy lifecycle event on the application server layer.

  4. Create a custom JSON object that assigns appropriate values to the configuration data attributes and add it to your stack configuration and deployment JSON.

  5. Deploy the application to the stack.

    Deployment runs the custom recipes, which use the configuration data values that you defined in the custom JSON to configure the application so that it can access the service.

This section describes how to have AWS OpsWorks Stacks application servers access a variety of AWS services. It assumes that you are already familiar with Chef cookbooks and how recipes can use stack and configuration JSON attributes to configure applications, typically by creating configuration files. If not, you should first read Cookbooks and Recipes and Customizing AWS OpsWorks Stacks.