Writing and managing your own CRs
Let’s start with a simple task. Let’s say that we have a shared RDS instance and we need to create databases in it. Since CloudFormation doesn’t support that out of the box, we will have to develop our CR.
Creating databases in RDS using CRs
We are going to create a CR that will connect to the RDS instance and perform SQL operations on it to create a database, user, password, and necessary privileges in the following steps:
- Let’s define our CR, like so:
// customdb.yamlCustomDb: Type: Custom::DB Properties: ServiceToken: # ARN of Lambda-backed CR DBName: # the name of our DB DBUser: # the username for our DB DBPassword: # the password for our DB's user RDSEndpoint: ...