Skip to content

Before provisioning the AWS RDS

Jorge Castro edited this page Mar 30, 2022 · 3 revisions
160799043 88e475e5 35bf 4e8f 95f2 4e479764b470

1. Tasks before provisioning the AWS RDS and loading (Windows Powershell)

1.1. Retrieving our current public IP address

We need this information in order to authorize connection to the AWS database port 3306 from our work or home. So we use the following command and we make a note of it:

(Invoke-WebRequest ifconfig.me/ip).Content.Trim()

1.2. Verify support of our MySQL engine version from AWS

Here we verify the MySQL engine supported versions by AWS RDS, our MySQL database is v8.0.26

aws rds describe-db-engine-versions `
    --engine mysql `
    --engine-version 8.0.26 `
    --query "DBEngineVersions[*].[Engine,EngineVersion,DBEngineDescription]"

1.3. Retrieve information on the DB parameter-groups

To be able to create a new parameter-group, the parameter-group-family is required.

aws rds describe-db-parameter-groups

1.4. Create a new parameter-group

  • What is a parameter-group and Why do we need to create a new one?

For AWS RDS instances, we manage our database engine configuration through the use of parameters in a DB parameter group. DB parameter groups act as a container for engine configuration values that are applied to one or more DB instances.

In order to set wider privileges to the master account (SUPER user) and be able to load the backup, we have to create a new parameter-group. To modify the default existing parameter group is not allowed by AWS. It is best practice to create a new parameter-group, modify the parameter we need, then associate the new parameter-group to the new RDS instance.

Amazon RDS is a managed service that does not provide SYS access (SUPER privileges). If binary logging is enabled on our MySQL DB instance, we need to set the log_bin_trust_function_creators parameter to true in the custom DB parameter group.

Once we are done with the migration, we can de-associate and parameter from the RDS instance and keep the default PG.

To create a new parameter-group:

aws rds create-db-parameter-group `
    --db-parameter-group-name "superuser" `
    --db-parameter-group-family "mysql8.0" `
    --description "restore db from dump"

1.5. Modify the parameter-group

To associate the parameter log_bin_trust_function_creators and set its value to 1.

aws rds modify-db-parameter-group `
    --db-parameter-group-name "superuser" `
    --parameters "ParameterName='log_bin_trust_function_creators', `
                  ParameterValue=1,ApplyMethod=immediate"

After modifying a parameter group AWS recommends to wait at least 5 minutes before we proceed to create the new instance.

This allows Amazon RDS to fully complete the create action before the parameter group is used as the default for a new DB instance. However we want to add this new parameter-group instead of using it as default when creating the DB instance. This is why we have to modify the instance to add the parameter-group.


160284366 8f290b43 0ff8 4dda 9856 466db7a61a5e