Terraform 0.11 has been released and while it has some nice improvements, it also has two major backwards incompatibilities:
-
The
apply
command is now interactive by default. It actually first runsplan
and then prompts the user to manually approve the plan before applying the changes. If you are using Terraform as part of an automated CI/CD process (and if you’re a Gruntwork customer, you probably are!), this will cause problems. The workaround is to add-auto-approve
to theapply
call. -
Terraform will now exit with an error if you have a resource with a
count
parameter set to anything other than1
and you try to reference that resource using the syntaxTYPE.NAME.ATTRIBUTE
, as opposed toTYPE.NAME.*.ATTRIBUTE
. The old syntax used to work fine, so this breaks a lot of code, including many Gruntwork modules. Worse yet, it’s very hard to find this error, as usingcount
is a very common pattern in Terraform, and the error only happens at runtime and only ifcount
happens to not be set to1
. We’ve filed a bug with the hopes that HashiCorp either reverts this behavior, or at the very least, provides tooling to find these errors viavalidate
orplan
, instead of waiting for things to blow up after runningapply
.
In the meantime, we do NOT recommend users upgrade to Terraform 0.11.