terraform-provider-mysql
terraform-provider-mysql copied to clipboard
Terraform crash during plan
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
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.