Course 1 Week 4 Building End-to-End Batch and Streaming Data Assignment Terraform Plan giving an error

Programming Assignment: Assignment 3: Building End-to-End Batch and Streaming Data Pipelines Based on Stakeholder Requirements

Terraform Plan command asking for a variable value

Error: No value for required variable

│ on variables.tf line 6:
│ 6: variable “region” {

│ The root module input variable “region” is not set, and has no default value. Use a -var or -var-file command line argument to provide a
│ value for this variable.


│ Error: No value for required variable

│ on variables.tf line 11:
│ 11: variable “vpc_id” {

│ The root module input variable “vpc_id” is not set, and has no default value. Use a -var or -var-file command line argument to provide a
│ value for this variable.


│ Error: No value for required variable

│ on variables.tf line 21:
│ 21: variable “source_host” {

│ The root module input variable “source_host” is not set, and has no default value. Use a -var or -var-file command line argument to provide
│ a value for this variable.


│ Error: No value for required variable

│ on variables.tf line 38:
│ 38: variable “source_username” {

│ The root module input variable “source_username” is not set, and has no default value. Use a -var or -var-file command line argument to
│ provide a value for this variable.


│ Error: No value for required variable

│ on variables.tf line 80:
│ 80: variable “scripts_bucket” {

│ The root module input variable “scripts_bucket” is not set, and has no default value. Use a -var or -var-file command line argument to
│ provide a value for this variable.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
coder@020174ffd1ca:~/project/terraform$ terraform plan
var.data_lake_bucket
S3 Bucket for Data lake

Enter a value:

Hello @amardeepw,

I could reproduce your issue with terraform plan, it seems you need to run step 1.6 source scripts/setup.sh. That would set those variables and then you could you go to terraform folder to run the terraform commands. Note, you need to run step 1.6 every time the terminal restarts. Thank you:

  1. terraform init
  2. terraform plan
  3. and finally terraform apply