From 8169c8e055ad761b5c759c84d6185f71421381c8 Mon Sep 17 00:00:00 2001 From: ryanzzff Date: Sun, 19 Sep 2021 00:35:52 +0800 Subject: [PATCH 1/2] fix deprecated warning - using locals instead of null_data_source --- service/etcd/main.tf | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/service/etcd/main.tf b/service/etcd/main.tf index d096e62..d5745d5 100644 --- a/service/etcd/main.tf +++ b/service/etcd/main.tf @@ -80,14 +80,6 @@ data "template_file" "install" { } } -data "null_data_source" "endpoints" { - depends_on = [null_resource.etcd] - - inputs = { - list = "${join(",", formatlist("http://%s:2379", local.etcd_vpn_ips))}" - } -} - output "endpoints" { - value = "${split(",", data.null_data_source.endpoints.outputs["list"])}" + value = formatlist("http://%s:2379", local.etcd_vpn_ips) } From ed05516533673f148e29872311e614f6a6773d6b Mon Sep 17 00:00:00 2001 From: ryanzzff Date: Sun, 19 Sep 2021 00:37:16 +0800 Subject: [PATCH 2/2] fix typo: initial_cluster --- service/etcd/main.tf | 2 +- service/etcd/templates/etcd.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service/etcd/main.tf b/service/etcd/main.tf index d5745d5..888f9de 100644 --- a/service/etcd/main.tf +++ b/service/etcd/main.tf @@ -64,7 +64,7 @@ data "template_file" "etcd-service" { vars = { hostname = element(local.etcd_hostnames, count.index) - intial_cluster = "${join(",", formatlist("%s=http://%s:2380", local.etcd_hostnames, local.etcd_vpn_ips))}" + initial_cluster = "${join(",", formatlist("%s=http://%s:2380", local.etcd_hostnames, local.etcd_vpn_ips))}" listen_client_urls = "http://${element(local.etcd_vpn_ips, count.index)}:2379" advertise_client_urls = "http://${element(local.etcd_vpn_ips, count.index)}:2379" listen_peer_urls = "http://${element(local.etcd_vpn_ips, count.index)}:2380" diff --git a/service/etcd/templates/etcd.service b/service/etcd/templates/etcd.service index 9512ad0..64346de 100644 --- a/service/etcd/templates/etcd.service +++ b/service/etcd/templates/etcd.service @@ -9,7 +9,7 @@ ExecStart=/opt/etcd/etcd --name ${hostname} \ --listen-client-urls "${listen_client_urls},http://localhost:2379" \ --advertise-client-urls "${advertise_client_urls}" \ --listen-peer-urls "${listen_peer_urls}" \ - --initial-cluster "${intial_cluster}" \ + --initial-cluster "${initial_cluster}" \ --initial-advertise-peer-urls "${listen_peer_urls}" \ --heartbeat-interval 200 \ --election-timeout 5000