TA-002-P · Question #315
A user runs terraform init on their RHEL based server and per the output, two provider plugins are downloaded: $ terraform init Initializing the backend... Initializing provider plugins... -Checking…
The correct answer is B. The .terraform/plugins directory in the directory terraform init was executed in. Terraform provider plugins are downloaded by terraform init into the .terraform/plugins subdirectory within the working directory.
Question
A user runs terraform init on their RHEL based server and per the output, two provider plugins are downloaded: $ terraform init Initializing the backend... Initializing provider plugins... -Checking for available provider plugins... -Downloading plugin for provider "aws" (hashicorp/aws) 2.44.0... -Downloading plugin for provider "random" (hashicorp/random) 2.2.1... :
Terraform has been successfully initialized! Where are these plugins downloaded to?
Options
- AThe .terraform.plugins directory in the directory terraform init was executed in.
- BThe .terraform/plugins directory in the directory terraform init was executed in.
- C/etc/terraform/plugins
- DThe .terraform.d directory in the directory terraform init was executed in.
How the community answered
(38 responses)- A5% (2)
- B92% (35)
- C3% (1)
Why each option
Terraform provider plugins are downloaded by `terraform init` into the `.terraform/plugins` subdirectory within the working directory.
The directory name `'.terraform.plugins'` is incorrect; the correct path is `.terraform/plugins`.
When `terraform init` is executed, it downloads necessary provider plugins and stores them in a local directory to manage their versions and ensure availability for the configuration. By default, these plugins are placed in the `.terraform/plugins` directory within the current working directory where `terraform init` was run.
`/etc/terraform/plugins` is a system-wide directory and not the default location for locally downloaded provider plugins by `terraform init`.
The directory name `'.terraform.d'` is not the standard location for Terraform provider plugins; the correct path is `.terraform/plugins`.
Concept tested: Terraform provider plugin local storage
Source: https://developer.hashicorp.com/terraform/cli/commands/init
Topics
Community Discussion
No community discussion yet for this question.