Skip to content

Commit

Permalink
Use deterministic ip_address_names to prevent failures on create or c…
Browse files Browse the repository at this point in the history
…hange
  • Loading branch information
wiktorn committed Jun 10, 2024
1 parent 6284b41 commit c40beda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions terraform/slurm_cluster/modules/_slurm_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ locals {
for index in range(local.num_instances) : {
hostname = local._hostnames[index]
network_interfaces = [
for nic in local._network_interfaces[index] : merge(
for nic_ind, nic in local._network_interfaces[index] : merge(
nic,
{
# generate unique name for ip address name based on hostname and first 16 characters of sha256 of (sub)network id
ip_address_name = "${local._hostnames[index]}-${substr(sha256(coalesce(nic.subnetwork, nic.network)), 0, 16)}"
ip_address_name = "${local._hostnames[index]}-nic${nic_ind}"
}
)
]
Expand Down

0 comments on commit c40beda

Please sign in to comment.