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

Object Partners profile.
Leave a Reply

Your email address will not be published.

Related Blog Posts
Natively Compiled Java on Google App Engine
Google App Engine is a platform-as-a-service product that is marketed as a way to get your applications into the cloud without necessarily knowing all of the infrastructure bits and pieces to do so. Google App […]
Building Better Data Visualization Experiences: Part 2 of 2
If you don't have a Ph.D. in data science, the raw data might be difficult to comprehend. This is where data visualization comes in.
Unleashing Feature Flags onto Kafka Consumers
Feature flags are a tool to strategically enable or disable functionality at runtime. They are often used to drive different user experiences but can also be useful in real-time data systems. In this post, we’ll […]
A security model for developers
Software security is more important than ever, but developing secure applications is more confusing than ever. TLS, mTLS, RBAC, SAML, OAUTH, OWASP, GDPR, SASL, RSA, JWT, cookie, attack vector, DDoS, firewall, VPN, security groups, exploit, […]