Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 120 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 120
Topic #: 1
[All Terraform Associate Questions]

You have to initialize a Terraform backend before it can be configured.

  • A. True
  • B. False
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
yaza
Highly Voted 2 years, 1 month ago
Selected Answer: B you cannot initialize something that does not exist, so obviously you have to configure it first
upvoted 27 times
...
zyxphreez
Highly Voted 2 years, 2 months ago
Selected Answer: B
you first configure the backed and then initialize ....therefore should be B
upvoted 10 times
...
RevSD
Most Recent 10 months, 3 weeks ago
In case of local backend , just an init is sufficient and no config is needed. May be question should be more clearer to say if it is local or remote
upvoted 2 times
...
samimshaikh
11 months ago
Selected Answer: B
B When you change a backend's configuration, you must run terraform init again to validate and configure the backend before you can perform any plans, applies, or state operations. After you initialize, Terraform creates a .terraform/ directory locally. This directory contains the most recent backend configuration, including any authentication parameters you provided to the Terraform CLI. Do not check this directory into Git, as it may contain sensitive credentials for your remote backend.
upvoted 2 times
...
shortcut
1 year ago
Selected Answer: B
I guess, here "initialize" means "instantiate" i.e. the backend must be there For e.g.- a S3 bucket should be present first before we can use it (i.e. configure it in HCL). So, from that perspective, it should be "A". However, we can also have local backends, which is where the terraform configuration file themselves reside, and we don't have to separately instantiate those. Hence, the answer is "B"
upvoted 1 times
...
aanataliya
1 year, 2 months ago
Selected Answer: A
Configure doesnt mean writing configuration of "backend block" in this context. Hashicorp always use "block" if they want to mention writing configuration. example : backend block, terraform block or cloud block. If I say, I want to configure linux server doesnt mean writing HCL for linux server. Just writing "backend block" doesnt actually configure backend. You have to run/execute that HCL "backend block" to actually create backend configuration. During actual backend configuration, Terraform writes the backend configuration in plain text in two separate files. Check Ref: https://developer.hashicorp.com/terraform/language/settings/backends/configuration And this cannot be done until we first execute init.
upvoted 2 times
3cc17f1
1 year, 1 month ago
That link you provided contradicts your answer: "When you change a backend's configuration, you must run terraform init again to validate and configure the backend before you can perform any plans, applies, or state operations." Clearly this suggests that configuration occurs PRIOR to initialisation.
upvoted 3 times
...
...
arunrkaushik
1 year, 3 months ago
Correct is B: How sleepy are people who voted for an option A... like compiling the code before writing it.
upvoted 2 times
...
milan92stankovic
1 year, 5 months ago
Selected Answer: B
I vote for B
upvoted 2 times
...
Priyankakanna
1 year, 6 months ago
What I understand is who choose false confusing with terminology its config nor writting configuration ie before creating the resource ie apply we need to initialise the backend so we have to run init so that from the configuration files it will download the necessary plugins for the backend and then apply the configuration to configure the resources
upvoted 3 times
...
piezaS
1 year, 6 months ago
A. True Before configuring and using a Terraform backend, you need to initialize it first. The initialization process sets up the backend configuration, such as the type of backend (e.g., S3, Azure Storage, etc.) and the connection details. This is done by running the terraform init command, which initializes the working directory and prepares it for Terraform operations, including the configuration of the backend.
upvoted 3 times
...
sdm13168
1 year, 6 months ago
Selected Answer: B
B you need to configure the backend first, then run terraform init
upvoted 1 times
...
kiran15789
1 year, 6 months ago
Selected Answer: A
Before configuring a backend in Terraform, it is necessary to initialize it. This is done by running the terraform init command, which sets up the working directory for the configuration, downloads any necessary plugins, and initializes the backend. Once the backend is initialized, you can configure it by editing the backend block in the Terraform configuration file.
upvoted 1 times
...
Ni33
1 year, 6 months ago
Selected Answer: B
B is the correct answer !
upvoted 1 times
...
Stanislav4907
1 year, 7 months ago
Selected Answer: A
Yes, before configuring a Terraform backend, you need to initialize it. Initializing a backend sets up the necessary resources and configurations to use a particular backend, such as creating storage containers or initializing remote state. To initialize a backend, you can use the terraform init command. This command reads the configuration files in your working directory and installs any necessary plugins or modules, as well as initializes the backend you have specified in your configuration. After initializing the backend, you can configure it by adding the appropriate configuration to your Terraform configuration files. The backend configuration typically includes details such as the backend type, the backend's credentials or access details, and any additional settings specific to the backend you're using. Once you have initialized and configured your backend, you can then use Terraform to create and manage infrastructure resources in the backend.
upvoted 2 times
...
Nunyabiznes
1 year, 8 months ago
Selected Answer: B
B. False The backend configuration is specified within the Terraform configuration files, typically in the main.tf file. You don't have to initialize a backend before configuring it; instead, you provide the backend configuration within the Terraform files, and then run terraform init. The initialization process will set up the backend as per the configuration provided. So, the backend configuration is done first, and then you initialize Terraform, which sets up the backend accordingly.
upvoted 4 times
...
_sreya23_
1 year, 8 months ago
Selected Answer: B
Without configuration (not writing code) you can't initialize it.
upvoted 1 times
...
khaled_razouk
1 year, 8 months ago
Selected Answer: B
you can't do that if it doesn't exist
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...