You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When set ebs_volume_count = 2 (more than 1), it will result in terraform error
╷
│ Error: Invalid index
│
│ on modules/cp-ec2-group/main.tf line 163, in resource "aws_volume_attachment" "default":
│ 163: instance_id = aws_instance.default.*.id[count.index]
│ ├────────────────
│ │ aws_instance.default is tuple with 1 element
│ │ count.index is 1
│
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the collection.
Environment (please complete the following information):
OS: Linux, Mint 20.3, 5.4.0-139-generic
Terraform v1.3.7
Additional Context
Could be solved by replace string in main.tf, at line 162.
e.g.:
instance_id = element(aws_instance.default.*.id, floor(count.index / max(var.ebs_volume_count, 1)))
p.s.
there is a limitation, changing the number of EBS will lead to reattaching disks to different instances
The text was updated successfully, but these errors were encountered:
Found a bug? Maybe our Slack Community can help.
Describe the Bug
When set ebs_volume_count = 2 (more than 1), it will result in terraform error
Expected Behavior
Create and attach two additional ebs volumes
Steps to Reproduce
for example
Environment (please complete the following information):
Additional Context
Could be solved by replace string in main.tf, at line 162.
e.g.:
instance_id = element(aws_instance.default.*.id, floor(count.index / max(var.ebs_volume_count, 1)))
p.s.
there is a limitation, changing the number of EBS will lead to reattaching disks to different instances
The text was updated successfully, but these errors were encountered: