CloudFormation

Everything can be done in the UI on console.aws.amazon.com. But we want to automate as much as possible.

For this reason, we won't create any resources manually anymore.

We will use CloudFormation instead so we can keep the infrastructure configuration under version control.

  • If something went wrong, CloudFormation will automatically rollback the changes.

  • You can delete all the resources created with one click.

  • Use detect drift to see if something was changed manually instead of using CloudFormation.

You can follow the progress for your changes
You can delete all the resources created and detect drift

How to use CloudFormation

You can use yml or json files. For yml files, resources take the following format:

You can find all the options available at AWS Resource and Property Types Reference.

Example to create an RDS database using AWS::RDS::DBCluster:

Creating the resources

We can manage CloudFormation resources from serverless.yml.

Here's the full file to create everything needed:

Read the documentation about Serverless Variables.

Configure the VPC manually with the console by following this step by step tutorial Configure and Connect to Serverless MySQL Database.

Last updated

Was this helpful?