How to do it...

Create a new CloudFormation template. We're going to add a total of 12 parameters to it:

  1. The first three parameters will contain the values we mentioned in the Getting ready section:
Parameters:  VPCId:     Type: AWS::EC2::VPC::Id     Description: VPC where DB will launch   SubnetIds:     Type: List<AWS::EC2::Subnet::Id>     Description: Subnets where the DB will launch (pick at least 2)   SecurityGroupAllowCidr:     Type: String     Description: Allow this CIDR block to access the DB     Default: "172.30.0.0/16"
  1. We're also going to add the database credentials as parameters. This is better than storing credentials in our infrastructure source code, but you should also investigate AWS Secret Manager and Parameter Store for even more secure options. ...

Get AWS SysOps Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.