Question
W12 Scenario: You have been asked to set up a series of new test databases on both MySQL and PostgreSQL in Google Cloud Platform. Your
W12 Scenario:
You have been asked to set up a series of new test databases on both MySQL and PostgreSQL in Google Cloud Platform. Your company wants to do extensive testing on each of them. To be able to do this in an efficient, predictable, and scalable manner, you choose to use terraform. You hope that by making this effort up front that your future efforts to create databases will be easier and more consistent.
W12 Scenario Submission Guidelines:
Be sure you submit all elements labeled by the bolded word, SHOW.
This week, we have extra help resources in place to ensure your success:
- PLEASE be sure you have gone through the excellent resources in this week's preparation post.
- Use the following videos (also in the stepping stone assignment):
- Overview Video
- Walkthrough Video
- Refer to these terraform documents (also mentioned in the videos above) for fine tuning deployment details:
- Google Terraform Documentation Part 1
- Google Terraform Documentation Part 2
- Your goal is to set up six total databases using terraform in YOUR personal GCP project (not the class project). Three should be in mysql and three in postgres. You will do this by using only ONE terraform (.tf) file that contains and creates six total databases.As always, be SURE to choose the smallest tier of resources (db-f1-micro). You should create one user for each database as well. You should name the databases as noted below in the SHOW section.
HINTS:
- You should start with only one database instance in your file and apply to ensure your syntax is correct. Then, you can add the remaining instances to get up to six and apply again.
- After using a terraform destroy command, you must change the name if you apply again. You can't reuse the name of the deleted instance.
- Use all lowercase characters for your database names.
SHOW 1: The contents of your terraform file which should include the following six databases (using tier = db-f1-micro and all lowercase characters for the database name) and one user for each (you can choose the passwords):
- mysql-yourlastname-development-db
- mysql-dev-user
- mysql-yourlastname-integrationtest-db
- mysql-int-user
- mysql-yourlastname-qa-db
- mysql-qa-user
- postgres-yourlastname-development-db
- postgre-dev-user
- postgres-yourlastname-integrationtest-db
- postgre-int-user
- postgres-yourlastname-qa-db
- Postgre-qa-user
SHOW 2: In your video, you must issue a successful terraform apply command.
SHOW 3: After the apply, show your GCP console with the six running databases under CloudSQL.
SHOW 4: Create a remote connection to one of the six databases using a client tool.
SHOW 5: In your video, you must issue a destroy command and then show that the databases are no longer in GCP.
REMINDER: If you do not use the smallest tier of resources (db-f1-micro), or if you forget to destroy/stop/delete your GCP databases, you will run out of credits. If your project budget has run out, please do not enter a personal credit card and instead see your instructor for access to the class project.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started