diff --git a/terraform/iac/config.tf b/terraform/iac/config.tf index e6e8092..10ed986 100644 --- a/terraform/iac/config.tf +++ b/terraform/iac/config.tf @@ -2,4 +2,5 @@ locals { instance_ips = [ "${data.contabo_instance.microk8s.ip_config[0].v4[0].ip}/32", ] + instance_mac_addr = replace(data.contabo_instance.microk8s.mac_address, ":", "_") } diff --git a/terraform/iac/encryption.tf b/terraform/iac/encryption.tf index e43fe88..005cc5e 100644 --- a/terraform/iac/encryption.tf +++ b/terraform/iac/encryption.tf @@ -1,6 +1,6 @@ resource "scaleway_object" "encryption_key" { bucket = scaleway_object_bucket.infra_assets.id - key = "keys/${replace(data.contabo_instance.microk8s.mac_address, ":", "_")}.key" + key = "keys/${local.instance_mac_addr}.key" content_base64 = base64encode(var.encryption_key) }