{"action":"closed","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3072","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3072/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3072/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3072/events","html_url":"https://github.com/hashicorp/terraform/issues/3072","id":103042143,"number":3072,"title":"Interpolation for provider field does not work ","user":{"login":"jarosite","id":1703401,"avatar_url":"https://avatars.githubusercontent.com/u/1703401?v=3","gravatar_id":"","url":"https://api.github.com/users/jarosite","html_url":"https://github.com/jarosite","followers_url":"https://api.github.com/users/jarosite/followers","following_url":"https://api.github.com/users/jarosite/following{/other_user}","gists_url":"https://api.github.com/users/jarosite/gists{/gist_id}","starred_url":"https://api.github.com/users/jarosite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarosite/subscriptions","organizations_url":"https://api.github.com/users/jarosite/orgs","repos_url":"https://api.github.com/users/jarosite/repos","events_url":"https://api.github.com/users/jarosite/events{/privacy}","received_events_url":"https://api.github.com/users/jarosite/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-25T15:03:52Z","updated_at":"2015-10-12T12:22:24Z","closed_at":"2015-10-12T12:22:24Z","body":"get error while trying to apply plan\r\nErrors:\r\n\r\n  * 1 error(s) occurred:\r\n\r\n* module root: 1 error(s) occurred:\r\n\r\n* aws_security_group.defaultAllOffice: resource depends on non-configured provider '${lookup(var.providers, count.index)}'\r\n\r\n```\r\n$terraform -v\r\nTerraform v0.6.3\r\n```\r\nuse case:\r\ncreate same security group in all aws regions:\r\n```javascript\r\nprovider \"aws\" {\r\n  alias = \"us-east-1\"\r\n  region=\"us-east-1\"\r\n}\r\nprovider \"aws\" {\r\n    alias = \"us-west-2\"\r\n    region = \"us-west-2\"\r\n}\r\nvariable \"providers\" {\r\n  default = {\r\n    \"0\" = \"aws.us-west-2\"\r\n    \"1\" = \"aws.us-east-1\"\r\n  }\r\n}\r\nresource \"aws_security_group\" \"defaultAllOffice\" {\r\n    name = \"defaultAllOffice ${lookup(var.providers, count.index)}\"\r\n    description = \"Used in the terraform ${lookup(var.providers, count.index)}\"\r\n    count = \"2\"\r\n    provider = \"${lookup(var.providers, count.index)}\"\r\n/* some sg rules there*/\r\n}\r\n```\r\n\r\nplease let me know if there better solution to do cross region transformation \r\n\r\n"}}