D is correct. You can test it out in a sample tf file. Init command goes through even if some variable that another resource is referencing is missing.
terraform init performs several initialization steps to prepare your Terraform working directory to be used with Terraform commands. However, it does not validate whether all required variables are present in the configuration or provided through another method. That validation happens during the terraform plan or terraform apply stage.
terraform init does:
1. Download and installs the necessary provider plugins.
2. Setup backend for storing state.
3. Download and install modules
D. Validates all required variables are present.
terraform init is a command that initializes a new or existing Terraform configuration. When you run terraform init, Terraform performs several tasks to set up the configuration for use, including:
Sources all providers present in the configuration and ensures they are downloaded and available locally
Connects to the backend, if one is configured, and performs any necessary setup steps
Sources any modules referenced in the configuration and copies their contents locally
Initializes the backend configuration and performs any necessary setup steps
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
elvancedonzy
Highly Voted 2 years, 5 months agoSilentH
Highly Voted 7 months, 2 weeks agoanand0310
Most Recent 2 months, 3 weeks agoDarrylNg
7 months agoBere
1 year, 3 months agoNi33
1 year, 6 months agoBolgarwow
7 months, 3 weeks agoNi33
1 year, 6 months agocamps
1 year, 7 months agoPower123
1 year, 7 months agobwahdi
1 year, 11 months agoFarziWaliMarzi
1 year, 11 months agoBurakko
2 years, 2 months agoflaviu888
2 years, 4 months agoEltooth
2 years, 4 months agoAhmad_Terraform
2 years, 5 months agohabros
2 years, 5 months agoOskar_Madin
2 years, 4 months ago