Terraform: Provider Alias Token Not Respected

Created on 28 Feb 2019  ยท  2Comments  ยท  Source: hashicorp/terraform

Terraform Version

Terraform v0.11.11

Terraform Configuration Files

provider "aws" {
  access_key = "${data.vault_aws_access_credentials.playground.access_key}"
  secret_key = "${data.vault_aws_access_credentials.playground.secret_key}"
  region     = "us-east-1"
  alias = "playground"
}

resource "aws_vpc_peering_connection" "vpc_platform" {
  provider = aws.playground
  peer_owner_id = "${data.terraform_remote_state.playground_account.account_id}"
  peer_vpc_id   = "${data.terraform_remote_state.platform_network.vpc_id}"
  vpc_id        = "${data.terraform_remote_state.playground_network.vpc_id}"
}

Debug Output

There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.

Error: Error parsing /Users/darnold/git/Terraform-Infrastructure/environments/AWSPlayGround/network/vpc_peering/main.tf: At 58:14: Unknown token: 58:14 IDENT aws.playground

Expected Behavior

As per, https://www.terraform.io/docs/configuration/providers.html#selecting-alternate-providers. I'd expect this syntax to work.

Actual Behavior

Error: Error parsing /Users/darnold/git/Terraform-Infrastructure/environments/AWSPlayGround/network/vpc_peering/main.tf: At 58:14: Unknown token: 58:14 IDENT aws.playground

Most helpful comment

Hi @darnold-harness,

For Terraform 0.11, the provider address must be given in quotes:

provider = "aws.playground"

For more information, see the 0.11 equivalent of those docs.

All 2 comments

Hi @darnold-harness,

For Terraform 0.11, the provider address must be given in quotes:

provider = "aws.playground"

For more information, see the 0.11 equivalent of those docs.

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings