hashicorp / terraform-provider-mysql

Terraform MySQL provider – This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
https://www.terraform.io/docs/providers/mysql/
Mozilla Public License 2.0
61 stars 190 forks source link

Terraform crash during plan #5

Open hashibot opened 7 years ago

hashibot commented 7 years ago

This issue was originally opened by @nhuray as hashicorp/terraform#11799. It was migrated here as part of the provider split. The original body of the issue is below.


Hi there,

Terraform crashes on plan. I didn't do anything in particular.

Terraform Version

I tried with different versions of Terraform in order to isolate the issue. It seems it works well with version 0.7.13 but failed with version 0.8.0.

Affected Resource(s)

This occurred when I run plancommand to create a mysql_database resource.

Terraform Configuration Files

# RDS state
# ---------------------------------
data "terraform_remote_state" "rds" {
  backend = "s3"
  config {
    bucket = "bit-terraform"
    key    = "database/${var.environment_name}/database/rds.tfstate"
    region = "us-east-1"
  }
}

# MySQL provider
# ---------------------------------
provider "mysql" {
  endpoint = "${data.terraform_remote_state.rds.rds_mysql_endpoint}"
  username = "${data.terraform_remote_state.rds.rds_mysql_master_username}"
  password = "${data.terraform_remote_state.rds.rds_mysql_master_password}"
}

# MySQL database
# ---------------------------------
resource "mysql_database" "test" {
  name = "test"
}

Panic Output

Panic Log

Expected Behavior

Plan properly the mysql_database resource

Actual Behavior

Terraform crash

Important Factoids

It seems when we hardcode the endpoint, username and password in the mysql provider, the plan command run correctly.

So it seems related to the terraform_state and the mysql provider, but the state exists and the path is the good one.