Week 3 Lab 1

Trying to understand the main.tf.

In the given main.tf, both the public and private subnets are using the same variables. I thought it should be different. May I have some explanation?

Hello @fongsow_59,
Yes you are correct, good catch since this the correct main.tf after a fix:

The lab can be still be completed. How does the two variables affect the setup?

Hello @fongsow_59,

These variables (defined in the variables.tf files) are used to pass values to the input variables of the bastion_host module. I guess you can still complete the lab and has no real effect connecting to the bastion_host module. But that would be an issue in your architecture since you don’t get to use private subnets you defined. Hope it helps

Thank you @fongsow_59 for reporting this issue. Indeed, the variables for the private subnets should be different. I guess that’s a typo in the solutions file and we will fix it.

The lab is still working because in this case the database is launched in a public subnet instead of a private subnet.