{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/15961","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/15961/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/15961/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/15961/events","html_url":"https://github.com/hashicorp/terraform/issues/15961","id":254036336,"number":15961,"title":"Terraform ignores provider in module","user":{"login":"FransUrbo","id":572706,"avatar_url":"https://avatars1.githubusercontent.com/u/572706?v=4","gravatar_id":"","url":"https://api.github.com/users/FransUrbo","html_url":"https://github.com/FransUrbo","followers_url":"https://api.github.com/users/FransUrbo/followers","following_url":"https://api.github.com/users/FransUrbo/following{/other_user}","gists_url":"https://api.github.com/users/FransUrbo/gists{/gist_id}","starred_url":"https://api.github.com/users/FransUrbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FransUrbo/subscriptions","organizations_url":"https://api.github.com/users/FransUrbo/orgs","repos_url":"https://api.github.com/users/FransUrbo/repos","events_url":"https://api.github.com/users/FransUrbo/events{/privacy}","received_events_url":"https://api.github.com/users/FransUrbo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-30T15:14:05Z","updated_at":"2017-08-30T18:20:25Z","closed_at":null,"author_association":"NONE","body":"I'm trying to setup multi-region, which resources in each region in its own module.\r\n\r\nHaving one provider in each module doesn't work, TF uses the \"top\" one.\r\n\r\n### Terraform Version\r\n0.9.8\r\n\r\n### Terraform Configuration Files\r\n#### ./main.tf\r\n\r\n```\r\nprovider \"aws\" {\r\n  region  = \"eu-central-1\" # Just for the sake of having three distinct regions\r\n}\r\n\r\n\r\nmodule \"test-ireland\" {\r\n  source = \"./ireland\"\r\n}\r\n\r\nmodule \"test-london\" {\r\n  source = \"./london\"\r\n}\r\n\r\n\r\ndata \"aws_availability_zones\" \"available\" {}\r\ndata \"aws_region\" \"current\" {\r\n  current = true\r\n}\r\n\r\n\r\noutput \"region_main\" {\r\n  value = \"${data.aws_region.current.name}\"\r\n}\r\n\r\noutput \"region_ireland\" {\r\n  value = \"${module.test-ireland.region}\"\r\n}\r\n\r\noutput \"region_london\" {\r\n  value = \"${module.test-london.region}\"\r\n}\r\n\r\n\r\noutput \"azs_main\" {\r\n  value = \"${data.aws_availability_zones.available.names}\"\r\n}\r\n\r\noutput \"azs_ireland\" {\r\n  value = \"${module.test-ireland.azs}\"\r\n}\r\n\r\noutput \"azs_london\" {\r\n  value = \"${module.test-london.azs}\"\r\n}\r\n```\r\n\r\n#### ./ireland/ireland.tf\r\n\r\n```\r\nprovider \"aws\" {\r\n  region  = \"eu-west-1\"\r\n}\r\n\r\ndata \"aws_availability_zones\" \"available\" {}\r\ndata \"aws_region\" \"current\" {\r\n  current = true\r\n}\r\n\r\noutput \"region\" {\r\n  value = \"${data.aws_region.current.name}\"\r\n}\r\n\r\noutput \"azs\" {\r\n  value = \"${data.aws_availability_zones.available.names}\"\r\n}\r\n```\r\n\r\n#### ./london/london.tf\r\n\r\n```\r\nprovider \"aws\" {\r\n  region  = \"eu-west-2\"\r\n}\r\n\r\ndata \"aws_availability_zones\" \"available\" {}\r\ndata \"aws_region\" \"current\" {\r\n  current = true\r\n}\r\n\r\noutput \"region\" {\r\n  value = \"${data.aws_region.current.name}\"\r\n}\r\n\r\noutput \"azs\" {\r\n  value = \"${data.aws_availability_zones.available.names}\"\r\n}\r\n```\r\n\r\n### Expected Behavior\r\nThe output should have outputted three different values, one for the main one, one for Ireland and one for London.\r\n\r\n### Actual Behavior\r\nTF uses the provider from the *main.tf* (Frankfurt) file, NOT the one within the modules.\r\n```\r\nazs_ireland = [\r\n    eu-central-1a,\r\n    eu-central-1b,\r\n    eu-central-1c\r\n]\r\nazs_london = [\r\n    eu-central-1a,\r\n    eu-central-1b,\r\n    eu-central-1c\r\n]\r\nazs_main = [\r\n    eu-central-1a,\r\n    eu-central-1b,\r\n    eu-central-1c\r\n]\r\nregion_ireland = eu-central-1\r\nregion_london = eu-central-1\r\nregion_main = eu-central-1\r\n```\r\n\r\n### Steps to Reproduce\r\n1. `terraform get`\r\n2. `terraform apply`"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/326076367","html_url":"https://github.com/hashicorp/terraform/issues/15961#issuecomment-326076367","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/15961","id":326076367,"user":{"login":"nokernel","id":7680572,"avatar_url":"https://avatars0.githubusercontent.com/u/7680572?v=4","gravatar_id":"","url":"https://api.github.com/users/nokernel","html_url":"https://github.com/nokernel","followers_url":"https://api.github.com/users/nokernel/followers","following_url":"https://api.github.com/users/nokernel/following{/other_user}","gists_url":"https://api.github.com/users/nokernel/gists{/gist_id}","starred_url":"https://api.github.com/users/nokernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nokernel/subscriptions","organizations_url":"https://api.github.com/users/nokernel/orgs","repos_url":"https://api.github.com/users/nokernel/repos","events_url":"https://api.github.com/users/nokernel/events{/privacy}","received_events_url":"https://api.github.com/users/nokernel/received_events","type":"User","site_admin":false},"created_at":"2017-08-30T18:20:25Z","updated_at":"2017-08-30T18:20:25Z","author_association":"NONE","body":"Do you see this behaviour with version 0.10.2?"}}
{"actor":{"display_login":"nokernel"}}