terraform-provider-docker icon indicating copy to clipboard operation
terraform-provider-docker copied to clipboard

Alias fails when passed to child module.

Open mavogel opened this issue 4 years ago • 6 comments

This issue was originally opened by @hongkongkiwi as https://github.com/hashicorp/terraform-provider-docker/issues/290. It was migrated here as a result of the community provider takeover from @kreuzwerker. The original body of the issue is below.


Terraform does not correctly handle aliases for this provider when passing to child module.
Terraform v0.13.0
+ provider registry.terraform.io/terraform-providers/docker v2.7.2

For example, this will fail with error during terraform validate: Error: missing provider provider["registry.terraform.io/hashicorp/docker"].foo

provider "docker" {
  alias = "foo"
  host = "tcp://127.0.0.1:2376/"
}

module "mycustommodule" {
  source = "./test2"
  providers = {
    docker = docker.foo
  }
}

mavogel avatar Dec 25 '20 19:12 mavogel

Any plan to address this issue?

madduci avatar Feb 25 '21 15:02 madduci

I can't reproduce this issue with the latest provider v2.11.0. Would you share code to reproduce this issue?

suzuki-shunsuke avatar Feb 25 '21 16:02 suzuki-shunsuke

I can reproduce it with the v2.11.0 with this code and terraform 0.14:

terraform {
  required_providers {
    docker = {
      source  = "kreuzwerker/docker"
      version = ">= 2.11.0"
    }
  }
}

provider "docker" {
  alias = "foo"
  host = "tcp://127.0.0.1:2376/"
}

module "mycustommodule" {
  source = "./test2"
  providers = {
    docker = docker.foo
  }
}

The child module looks for the "registry.terraform.io/hashicorp/docker"

madduci avatar Feb 26 '21 04:02 madduci

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. If you don't want this issue to be closed, please set the label pinned.

github-actions[bot] avatar Apr 27 '21 10:04 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. If you don't want this issue to be closed, please set the label pinned.

github-actions[bot] avatar Jun 27 '21 10:06 github-actions[bot]

Seems to be working in 3.0.1.

pedromss avatar Mar 05 '23 11:03 pedromss