Instance ID's shifted a spot (Using count) #155
Labels
bug
Addresses a defect in current functionality.
service/ec2
Issues and PRs that pertain to the ec2 service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
This issue was originally opened by @markmaas as hashicorp/terraform#6392. It was migrated here as part of the provider split. The original body of the issue is below.
Dear Reader,
Because I was running into this problem:
hashicorp/terraform#6391
I refactored my terraform code using this elb setup:
and this instance setup:
Where public_subnets comes from the vpc module I wrote:
output:
main:
And a zones / blocks variable like this:
When creating this thing, this variable
instances = ["${split(",", aws_instance.haproxy.*.id)}"]
get's filled corectly, except it seems to shift all the instance id's. So that spot number "0" is empty. This then results in the following error:Any idea how I could shift those id's back one spot?
Thanks,
Mark
Terraform Version
Terraform v0.6.15
Affected Resource(s)
Please list the resources as a list, for example:
Expected Behavior
To have all the instances added to the elb
Actual Behavior
Terraform stops with an error saying it cannot add an empty instance id
The text was updated successfully, but these errors were encountered: