AWS RDS MYSQL Playground

Do you need a reliable database platform to hammer out some new application ideas?

Or, maybe you’d like to learn MYSQL in a disposable environment?

This Hashicorp Terraform MYSQL RDS Module will build all the required AWS VPC networking, Security Groups, and RDS fundamentals in an average of 5 minutes to create, and allow you to connect to a MYSQL database from your home workstation.

Some Prerequisites:

Basic Steps:

git clone https://github.com/dps3ven/terraform-aws-rds

cd terraform-aws-rds

terraform init 

terraform plan

terraform apply -auto-approve

cat mysql_login

Copy the contents of the mysql_login output into the same terminal window

If all goes well, you should see the following:

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

If all does not go well, try the following:

Verify mysql client:

mysql --version
mysql  Ver 14.14 Distrib 5.7.34, for Linux (x86_64) using  EditLine wrapper

Verify AWS authentication:

aws s3 ls
# should return no error

Out of the box, the module does allow you to specify both the database password and the public IP address of your workstation. There are defaults for these variables, but I recommend using those that are specific to you.

See both the README from the module and Hashicorp Terraform Variable Declaration

In a production environment, the database password would of course not be directly entered as a variable in the configuration. Ideally, the secrets would be generated in a different CICD pipeline. For the purpose of this module however, AWS Secrets Manager is leveraged to create, store, and retrieve the database password. This is meant only to be a sample of how to use secrets.

When finished, don’t forget to run:

terraform destroy -auto-approve

About the Author

Dan Peterson profile.

Dan Peterson

Sr Consultant
Leave a Reply

Your email address will not be published. Required fields are marked *

Related Blog Posts
Airflow Logging: Task logs to Elasticsearch
This is part three of a five-part series addressing Airflow at an enterprise scale. I will update these with links as they are published. Airflow: Planning a Deployment Airflow + Helm: Simple Airflow Deployment More […]
Using Nix as a Professional
How to use Nix as a tool to optimize developer time with real-life examples.
Enterprise Auth for Airflow: Azure AD
This is part three of a five-part series addressing Airflow at an enterprise scale. I will update these with links as they are published. Airflow: Planning a Deployment Airflow + Helm: Deploying the Chart Without […]
More Charts: Adding TLS to Airflow
In this post, we will be adding TLS to Airflow on Azure Kubernetes Service. This is part three of a five-part series addressing Airflow at an enterprise scale. I will update these with links as […]