Skip to content
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

InCollect ErrorMessage("features": required field is not set) #7013

Closed
ghost opened this issue May 19, 2020 · 2 comments
Closed

InCollect ErrorMessage("features": required field is not set) #7013

ghost opened this issue May 19, 2020 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented May 19, 2020

This issue was originally opened by @arukiidou as hashicorp/terraform#24842. It was migrated here as a result of the provider split. The original body of the issue is below.


InCollect ErrorMessage.
The error message shows "features": required field is not set",
But it was InCollect ErrorMessage.

Terraform Version

Terraform v0.12.24
+ provider.azurerm v2.8.0

Terraform Configuration Files(InCollect)

[azurerm.tf]
provider "azurerm" {
  version = "=2.8.0"
  features {}
}
[main.tf]
provider "azurerm" {
  source                = "../modules/azurerm"
}
module "resource_group" {
  source                = "../modules/resource_group"
  
  location              = local.location
  resource_group_name   = "${local.application_name}-${local.environment_type}"
  tags_application_name = local.application_name
  tags_environment_type = local.environment_type
}

Debug Output

None.

Crash Output

None.

Expected Behavior

For Example...

> terraform plan
terraform : [31m
発生場所 行:1 文字:1
+ terraform plan
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ([31m:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
[1m[31mError: [0m[0m[1m provider is not applicatable module files. [0m
[0m[0m[0m

Actual Behavior

terraform : [31m
発生場所 行:1 文字:1
+ terraform plan
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ([31m:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
[1m[31mError: [0m[0m[1m"features": required field is not set[0m
[0m[0m[0m

Steps to Reproduce

  1. Not Included "provider - azurerm" from module, and not in the same folder
    (See Behavior/Configration Files)

  2. Included "provider - azurerm" in main.tf

[main.tf]
provider "azurerm" {
  version = "=2.8.0"
  features {}
}
module "resource_group" {
  source                = "../modules/resource_group"
  
  location              = local.location
  resource_group_name   = "${local.application_name}-${local.environment_type}"
  tags_application_name = local.application_name
  tags_environment_type = local.environment_type
}
  1. terraform plan
    (SUCSESS)

Additional Context

None.

References

#5880

@tombuildsstuff
Copy link
Member

hi @arukiidou

Thanks for opening this issue.

Taking a look through at the configuration above, it appears that you're trying to source a provider from a module, which isn't supported. Instead this'll need to be defined in the root of the Terraform Configuration - and then passed into the Modules where you'd like to use it (see here) - for example:

provider "azurerm" {
  version = "=2.8.0"
  features {}
}

module "resource_group" {
  source                = "../modules/resource_group"
  
  location              = local.location
  resource_group_name   = "${local.application_name}-${local.environment_type}"
  tags_application_name = local.application_name
  tags_environment_type = local.environment_type

  providers = {
    azure.default = "azurerm.default"
  }
}

Would you be able to take a look and see if that works for you? Since this should be fixed by updating the Terraform Configuration I'm going to close this issue for the moment - but please let us know if that doesn't work for you and we'll take another look.

Thanks!

@ghost
Copy link
Author

ghost commented Jun 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant