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"
}
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 version0.8.0
.Affected Resource(s)
This occurred when I run
plan
command to create amysql_database
resource.Terraform Configuration Files
Panic Output
Panic Log
Expected Behavior
Plan properly the
mysql_database
resourceActual Behavior
Terraform crash
Important Factoids
It seems when we hardcode the
endpoint
,username
andpassword
in themysql
provider, theplan
command run correctly.So it seems related to the
terraform_state
and themysql
provider, but the state exists and the path is the good one.