RDS
RDS (Relation Database Service) provides pre-configured and easy-to-use databases. Updates, backups, and fail-overs are managed by AWS. While you could setup your own EC2 instances running MySQL, we highly recommend using RDS.
Content Controller works on MySQL 5.7 & 8.0 and the Aurora counterparts for those versions. We recommend MySQL 8.0, and that is the version we test against daily. Content Controller does not support read replicas (you can create one for your own usage, but the application won’t take advantage of it).
Go to Services -> Relational Database Service.
Subnet Groups
Before launching your database, we’ll need to create a Subnet Group to launch it in.
- Click on Subnet groups on the left sidebar and click the orange Create DB Subnet Group button.
- Enter
Rustici CC RDS Subnet Group
for the name, enter a description, and chooseRustici CC VPC
for the VPC. - Under Add Subnets, add both of your private subnets (no public subnets). Note: AWS doesn’t show the subnet names here, so you may need to refer to the VPC Subnet list and take note of the IDs.
Parameter Groups
A parameter group allows you to set certain DB parameters that will be applied when an instance is launched. We’ll need a custom one.
- Click on Parameter groups on the left sidebar and click the orange Create parameter group button.
- Choose mysql8.0 for the parameter group family, enter
Rustici-CC RDS-Paramter-Group
for the name, and enter a description, then click Create. - Select the newly created parameter group from the list.
- Search for
log_bin_trust_function_creators
, check the box beside it, and click Edit parameters. Set it to1
, and click Save changes.
Instances
- Click on Databases on the left sidebar and click the orange Create database button.
- Select Standard create and MySQL.
- Select the latest 8.0 version for Engine Version.
- Select Production - MySQL.
- Select Multi-AZ DB instance.
- Set the DB instance identifier to
cc-prod
. - Set master username to
ccroot
or the value you chose formysql_root_user
ingroup_vars/env.yml
earlier. - Set master password to the value specified for
mysql_root_password
ingroup_vars/env.yml
. - For the DB instance class select at least a t4g.medium. Check out our recommendations in Infrastructure Requirements or reach out to us if you have questions about size for your instance.
- For storage type choose
General Purpose (SSD)
. - For allocated storage enter at least 100 GB Read here for more information about IOPS vs storage size **Note that IOPS are the first limit people usually hit when scaling up with Content Controller
- Enter the following values under Connectivity.
- Virtual Private Cloud:
Rustici CC VPC
- Subnet group:
rustici cc rds subnet group
- Public accessibility: No
- Availability zone: No preference
- VPC security group: Choose existing, then remove default, and add
CC Database
- Database port: 3306
- Virtual Private Cloud:
- For database authentication select Password authentication.
- Configure the monitoring section to your preference.
- Enter the following values under Additional Configuration and click Create database.
- Database name: leave blank
- DB parameter group:
rustici-cc-rds-parameter-group
- Option group:
default:mysql-8-0
- Backup: Your preference - at least 1 day
- Encryption: Your preference
- Log exports: Your preference
- Maintenance: Your preference (but we recommend Enable auto minor version upgrade so that security patches are applied quickly)
Configuration
Now that your database instance is up and running, you will need to setup the playbooks to point Content Controller at it.
- Select your new database from the Instances list in the Relational Database Service console.
- Scroll down to the Connectivity & security panel, and copy the Endpoint. (It should look something like
cc-prod.************.us-east-1.rds.amazonaws.com
). - SSH to your Ansible instance and navigate to your
ContentController-PublicDeploy
folder. - Edit
group_vars/content_controller.yml
. - Find the line
cc_db_host: localhost
and replacelocalhost
with the endpoint you copied from the RDS console. - Save and exit.