Closed hashibot closed 6 years ago
Unfortunately, there's no simple way to keep Terraform from consuming MySQL connections on a terraform plan
– even if it's just other resources that are changing. Terraform performs a read operation by default on plan
. You can try -refresh=false
, but usually a plan
has to refresh in order to figure out what's changed.
This issue was originally opened by @rv-acabrera as hashicorp/terraform#11311. It was migrated here as part of the provider split. The original body of the issue is below.
Hi,
Terraform Version
0.8.2 - didn't see this fixed in any of the newer version changelogs.
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
I was expecting a terraform plan targeting a single AWS resource to not refresh the mysql provider.
Actual Behavior
The mysql database (rds) was at max connections and not accepting new connections. When we ran a terraform plan, the plan failed and the console returned an error saying that it could not establish a connection the the mysql database. Unfortunately, I don't have the exact output but we tried multiple times and received the same message. When we ran a terraform plan targeting a specific non-mysql resource (aws iam policy), it still failed with the same MySQL error message.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan -target aws_iam_policy.test
Important Factoids
The Mysql instance was RDS MySQL