-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TerraformTask@v4 Plan Multiple Provider Warning conflicts with tflint terraform_required_providers
#229
Comments
Hi, Not sure why it was implemented in that way. Let me take a look and see if I can decipher why. Br Manuel |
Hi, the purpose of this warning is to warn if you have multiple cloud providers. like you should not have aws and azure in the same .tf file. What version of the task do you use? And if you could supply an example of a submodule that throws the warning. Br |
I am using - task: TerraformTaskV4@4
displayName: "Apply Plan"
inputs:
provider: azurerm
command: apply
commandOptions: tfplan
environmentServiceNameAzureRM: $(TF-SERVICE-CONN) In the main part of my config I have: terraform {
required_version = ">= 1.9.2"
# Backend parameters configured via --backend-config file passed during terraform init
backend "azurerm" {
}
required_providers {
azurerm = {
version = "~> 3.115"
source = "hashicorp/azurerm"
}
azuread = {
source = "hashicorp/azuread"
version = "~> 2.53"
}
local = {
source = "hashicorp/local"
version = "~> 2.4"
}
time = {
source = "hashicorp/time"
version = "0.12.0"
}
tls = {
source = "hashicorp/tls"
version = "~> 4.0"
}
}
}
provider "azurerm" {
subscription_id = local.management_sub_id
storage_use_azuread = true
features {}
}
provider "azuread" {
tenant_id = data.azurerm_client_config.current.tenant_id
} And in a local submodule (path terraform {
required_version = ">= 1.9.2"
required_providers {
azuread = {
source = "hashicorp/azuread"
version = "~> 2.53"
}
}
} I've double checked that I'm not passing any other provider statements in elsewhere in the configuration. |
Hello,
I recently converted a pipeline over to using TerraformTasks from running terraform directly via script commands and it is giving me the following warning for provider settings a submodule:
##[warning]Multiple provider blocks specified in the .tf files in the current working directory.
If I remove the provider constraints in the submodule, it conflicts with tflint in that submodules should declare required provider versions:
https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md
Can someone point me to some documentation as to why TerraformTasks is throwing a warning for submodules declaring their provider constraints?
Thank you.
The text was updated successfully, but these errors were encountered: