Skip to content

Placement group contains already 10 servers #641

Answered by sshcherbinin
jonas-tm asked this question in Q&A
Discussion options

You must be logged in to vote

release v1.10.4

for now this throws an error if there are 10 (20, 30, ...) nodes in agent_nodes

terraform:
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.

for this:
hcloud_placement_group.agent[floor((index(keys(local.agent_nodes), each.key) + 1) / 10)].id

and this:
hcloud_placement_group.control_plane[floor((index(keys(local.control_plane_nodes), each.key) + 1) / 10)].id

floor((10 + 1) / 10) = 1

fix:
hcloud_placement_group.agent[floor((index(keys(local.agent_nodes), each.key)) / 10)].id
hcloud_placement_group.control_plane[floor((index(keys(local.control_plane_nodes), each.key)) / 10)].id

floor…

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
7 replies
@jonas-tm
Comment options

@mysticaltech
Comment options

@mysticaltech
Comment options

@jonas-tm
Comment options

@mysticaltech
Comment options

Comment options

You must be logged in to vote
1 reply
@jonas-tm
Comment options

Comment options

You must be logged in to vote
2 replies
@mysticaltech
Comment options

@mysticaltech
Comment options

Answer selected by mysticaltech
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants