Skip to content

Validation fails for provider proxy configuration #21706

@talton-heb

Description

@talton-heb

Terraform Version

$ terraform -v
Terraform v0.12.1

Terraform Configuration Files

library_module/main.tf

provider "aws" {
}
provider "aws" {
  alias = "other_provider"
}
terraform {
  required_providers {
    aws = "~> 2.14"
  }
}

data "aws_region" "current" {}
output "region" {
  value = data.aws_region.current
}

data "aws_region" "other" {
  provider = aws.other_provider
}
output "other_region" {
  value = data.aws_region.other
}

Debug Output

N/A

Crash Output

N/A

Expected Behavior

Running terraform validate library_module should pass.

Actual Behavior

$ terraform validate library_module

Error: Missing required argument

  on library_module/main.tf line 1, in provider "aws":
   1: provider "aws" {

The argument "region" is required, but no definition was found.


Error: Missing required argument

  on library_module/main.tf line 3, in provider "aws":
   3: provider "aws" {

The argument "region" is required, but no definition was found.

Steps to Reproduce

  1. Run terraform validate library_module/

Additional Context

From #21699, proxy provider configurations in a module should only have the alias attribute.

Proxy configurations should be treated as valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions