hashicorp / terraform-provider-terraform

Terraform terraform provider
https://www.terraform.io/docs/providers/terraform/
Mozilla Public License 2.0
23 stars 22 forks source link

Terraform Crash EOF from reading from a remote state file #5

Open hashibot opened 6 years ago

hashibot commented 6 years ago

This issue was originally opened by @mechastorm as hashicorp/terraform#14838. It was migrated here as a result of the provider split. The original body of the issue is below.


I am getting a TF crash whenever I read from a remote state. It is only this particular state file.

I tried to re-create it from scratch and it worked until I explicitly added the aws_vpc resource (which was imported from an existing one.

Terraform Version

Terraform v0.9.5

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

data "terraform_remote_state" "vpc-dev" {
  backend = "s3"

  config {
    bucket  = "mybucket}"
    key     = "states/dev-us-west-2/vpc.tfstate"
    region  = "us-west-2"
    profile = "my-profile"
  }
}

The tfstate file of states/dev-us-west-2/vpc.tfstate with info redacted

https://gist.github.com/mechastorm/6127dbe919e8bd5f73495ae66352fad6

Debug Output

Debug log with info redacted https://gist.github.com/mechastorm/4a9e6a9e5c00734dd9bd31eae28bf83c

Panic Output

Crash.log with info redacted https://gist.github.com/mechastorm/cdd38789b03fba93e9a57d302a24ca64

Expected Behavior

Should run plan with zero changes and a successful exit

Actual Behavior

Terraform crash with an EOF error when reading a remote state

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan or terraform apply

Important Factoids

The vpc.tfstate has some empty output strings.