Closed hashibot closed 5 years ago
With the release of Terraform 0.12 and some additional validations we've added on the DigitalOcean provider side, I think we can now close this one out. The error message here is much more useful:
Error: Incorrect attribute value type
on terraform-testing.tf line 18, in resource "digitalocean_floating_ip" "auto_chess":
18: droplet_id = "${digitalocean_droplet.auto_chess.region}"
Inappropriate value for attribute "droplet_id": a number is required.
This issue was originally opened by @Noah-Huppert as hashicorp/terraform#15053. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform Version
Affected Resource(s)
All? Found bug with:
digitalocean_floating_ip
digitalocean_record
I believe this is a Terraform core issue.
Terraform Configuration Files
Debug Output
Gist
Panic Output
None
Expected Behavior
Terraform should inform the user that the value they provided for
digitalocean_floating_ip.auto_chess.droplet_id
is incorrect like so:Actual Behavior
Terraform claims that
digitalocean_floating_ip.auto_chess.ip_address
is not found. This causes one to start debugging their code for a link/dependency error (Callingterraform graph
, addingdepends_on
to everything, etc...). Instead of debugging their code for an incorrectdigitalocean_floating_ip.auto_chess.droplet_id
value.Steps to Reproduce
digitalocean_floating_ip.auto_chess
droplet_id
parameter is intentionally set to be adigitalocean_droplet
's region when it is supposed to be an id.digitialocean_record.auto_chess
digitalocean_floating_ip.auto_chess.ip_address
terraform plan
digitalocean_record
Important Factoids
Error messages and example code are in a module named
auto-chess
. Not included in the example code is adigitalocean_droplet
namedauto_chess
, this is not important to the issue.References
None