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 CloudFormationarrow-up-right 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 driftarrow-up-right 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:

circle-info

You can find all the options available at AWS Resource and Property Types Referencearrow-up-right.

Example to create an RDS database using AWS::RDS::DBClusterarrow-up-right:

Creating the resources

We can manage CloudFormation resources from serverless.yml.

Here's the full file to create everything needed:

circle-info

Read the documentation about Serverless Variablesarrow-up-right.

circle-info
circle-info

Configure the VPC manually with the console by following this step by step tutorial Configure and Connect to Serverless MySQL Databasearrow-up-right.

Last updated