Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Terraform Community Providers considered to be third-party?

Tags:

I'm preparing for the Terraform Associate Certification exam. I've done a practice exam on Udemy and got a question about automatic install of community providers wrong. However, based on actual terraform behaviour I question whether the exam (or Terraform's documentation) is incorrect. It may be the case that my question should be directed at the author of the practice exam, but I thought I'd post it here in case a clarification might help someone else.

The exam question is:

True or False? terraform init cannot automatically download Community providers.

My answer is false, incorrect according to the exam with the following explanation:

Explanation

Anyone can develop and distribute their own Terraform providers. (See Writing Custom Providers for more about provider development.) These third-party providers must be manually installed, since terraform init cannot automatically download them.

https://www.terraform.io/docs/configuration/providers.html#third-party-plugins

Terraform's init documentation confirms this (note no reference to community plugins):

Note that terraform init cannot automatically download providers that are not distributed by HashiCorp. See Third-party Plugins below for installation instructions.

But if you add a community provider to your config and run terraform init community plugins do install automatically:

provider "auth0" {
  version = "> 0.8"
}
$ terraform init

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "auth0" (terraform-providers/auth0) 0.10.2...
...

So I can only assume that based on actual terraform functionality Community Providers are not considered third-party plugins?

like image 835
awolski Avatar asked May 27 '20 16:05

awolski


1 Answers

The documentation and practice exam are both based on outdated information. Formerly, that answer and documentation were both correct, and you were forced to manually install custom providers. The method and process described in the documentation was completely accurate.

However, on January 15th, 2020, the Terraform registry was expanded to provide functionality for community providers in addition to community modules. The official announcement from Hashicorp can be viewed here. Now the method you described (which also functioned for third party modules) is valid. You can also view the provider registry which makes this possible. Note that Terraform Cloud and Terraform Enterprise both also provide private registries with this functionality.

Updated notes: actually, Terraform Cloud's private registry is limited to modules at the moment, including with a VCS connected provider. However, the TF Cloud Registry interface implies the feature will come eventually. Also, the community provider support is expanding further with Terraform 0.13 release notes.

On a side note, I would not currently trust in the integrity of any third-party study guides for Hashicorp certifications. The exams only recently exited beta. I am struggling to find the announcement (it was either in an official blog post or a partner email), but it was after mid-April 2020. When I acquired my Terraform (late January 2019) and Vault (early April 2020) certifications, both were still in beta, and this was evident by interesting occurrences in the exams, such as a few questions being repeated verbatim. I would trust the official Hashicorp study guide more than anything else at the moment.

like image 72
Matt Schuchard Avatar answered Oct 02 '22 15:10

Matt Schuchard