AWS OpsWorks
User Guide (API Version 2013-02-18)

Step 3.1: Add a Back-end Database

The new version of SimplePHPApp stores its data in a back-end database. AWS OpsWorks Stacks supports two types of database servers:

You can also use other databases, such as Amazon DynamoDB, or create a custom layer to support databases such as MongoDB. For more information, see Using a Back-end Data Store.

This example uses a MySQL layer.

To add a MySQL layer to MyStack

  1. On the Layers page, click + Layer.

  2. On the Add Layer page, for Layer type, select MySQL, accept the default settings, and click Add Layer.

To add an instance to the MySQL layer

  1. On the Layers page's MySQL row, click Add an instance.

  2. On the Instances page, under MySQL, click Add an instance.

  3. Accept the defaults and click Add instance, but don't start it yet.


AWS OpsWorks Stacks automatically creates a database named using the app's short name, simplephpapp for this example. You'll need this name if you want to use Chef recipes to interact with the database.