Week 4 lab

Everything is smooth with week 4 lab until ‘terraform plan’ is added to the terminal. At this point, a series of prompts beginning with

var.db_sg_id

  • Security group ID for RDS*

  • Enter a value:*

Unfortunately my knowledge of TF is limited and I’m unable to resolve. The prompts, regardless of what I for values, usually end with a series of logs and this:

Plan: 9 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + data_lake_bucket_id = (known after apply)
  + scripts_bucket_id   = (known after apply)
╷
│ Error: no matching EC2 Subnet found
│ 
│   with module.etl.data.aws_subnet.private_a,
│   on modules/etl/network.tf line 1, in data "aws_subnet" "private_a":
│    1: data "aws_subnet" "private_a" {
│ 
╵
╷
│ Error: reading EC2 Security Group: operation error EC2: DescribeSecurityGroups, https response error StatusCode: 400, RequestID: ef715870-fb90-4f46-87b3-6f80b741dbf1, api error InvalidGroupId.Malformed: Invalid id: "0" (expecting "sg-...")
│ 
│   with module.etl.data.aws_security_group.db_sg,
│   on modules/etl/network.tf line 5, in data "aws_security_group" "db_sg":
│    5: data "aws_security_group" "db_sg" {
│ 

The lab walkthrough included footage of removing comments in 2 TF files which I did; however the video’s use of ‘terraform plan’ doesn’t match the prompts I received. Help. Thank you.

Hello @Jesse_B
I went through the lab and was not able to reproduce the problem. Everything seems to be working fine.
However, from the logs you have attached, I guess that the problem might be with a network problem. Can you please make sure that you have chosen the correct subnet for your Cloud9 environment and try again? You should choose the public subnet, and choosing the private ones creates issues.

thank you @Amir_Zare. I’ll try again tomorrow.