From baa44d52c37b0c1f3422e58df6b281e8f7f0e3c5 Mon Sep 17 00:00:00 2001 From: Zulhilmi Zainudin Date: Tue, 17 Aug 2021 15:25:40 +0800 Subject: [PATCH] Fix "terraform init" issue --- .terraform.lock.hcl | 80 +++++++++++++++++++++++++++++++++++++++++ main.tf | 6 ++-- modules/k3s/main.tf | 19 ++++++---- modules/k3s/provider.tf | 8 +++++ variables.tf | 2 +- versions.tf | 2 +- 6 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 .terraform.lock.hcl create mode 100644 modules/k3s/provider.tf diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl new file mode 100644 index 0000000..21edcea --- /dev/null +++ b/.terraform.lock.hcl @@ -0,0 +1,80 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/civo/civo" { + version = "0.10.9" + constraints = "0.10.9" + hashes = [ + "h1:IwHuNJfXY/cXnn3Y1w8pK7jdyo68SRUr+t9yQkL0xxc=", + "zh:00956cdbb13ba152b5b41b4ffff79e2147c1232237099e3ab52c4406a081d93f", + "zh:2b1870ff09ed9d2e9b470477fff8fdca2c70689e235eed812013ac7050261006", + "zh:3bad45dab8ca85abf9a9338b2a048f33f0e50ebc87b9973a742d034de6950f24", + "zh:4315a3decfa21daccad1ad2423a791797c31ba2ce16dab34a34eeea558a424fc", + "zh:4fbab4cc81ff6d737e8c2e244c2f8496f2242ce29d8ebeb6d7f9d3a5c59ba63f", + "zh:65cc1d4cadbfc2a22155a779b1e83da14cdf8e4d2e80ee62be322e4cbceb186d", + "zh:666a767c0c7f90df79fba8c4036cfd7897027d4b68d06cbe4ddca991841b26fd", + "zh:b53ed9ba9c6d884620b9f6151af700619c0ea88badc29e02593b730f14fd01f9", + "zh:cc69dd3f8457843f92682e7423c6dacd9a505dbd5031a8bc657caebf43d9ad00", + "zh:d6a72ad92ae78dc2380a825b1211075b4481e6a869299b819ac0307d453df379", + "zh:d6c3a55ea55bc2a7d1e3a63dec4c95944881177fae62692055774b1087dc38f4", + "zh:f18681a5f3df664dc97622889fb08fb88dc6f7340fbf6a752c47277944ffce52", + "zh:fbf47f0d7773713bf826b3cb772736ab4bb2afa6598344c38a21b94a597d865f", + ] +} + +provider "registry.terraform.io/hashicorp/helm" { + version = "2.2.0" + constraints = "2.2.0" + hashes = [ + "h1:liBgOoOXhA2A1DbL0oaifyNnoGOyHxMG4+xD1Kl58XA=", + "zh:01341dd1e9cc7e7f6999e11e7473bcdca2dd72dd27f91beed1f4fb599a15dfba", + "zh:20e86c9eccd3a81ef5ac243af31b61fc4d2d679437384bd0870e92fa1b3ed6c9", + "zh:22a71127c5dbea4f62edb5bcf00b5c163de04aa19d45a7a1f621f973ffd09d20", + "zh:28ab7c84a5f8ed82fc520668db93d650571ddf59d98845cb18a1fa1a7888efc0", + "zh:3985a30929ad8fdc6b94f0e1cbd62a63db75ee961b8ba7db1cf4bfd29e8009ff", + "zh:477d92e26ba0c906087a5dd827ac3917dad7d5af770ee0ab4b08d0f273150586", + "zh:750928ec5ef54b2090bd6a6d8a19630a8712bbbccc0429251e88ccd361c1d3c0", + "zh:a615841fd90094bddc1269127e501fa60453c441b9548ff73752fe14efc38ed0", + "zh:e762aca7883374fa255efba50f5bdf791fece7d61e3920e593fb1a2cbb598981", + "zh:f76f372ead52948ca53610b371cb80c80ebcf058ef0a5c0ce9f0ce38dcc9a8eb", + "zh:fa36fe93ed977f4478cc6547ec3c45c28e56f10632e85446b0c3d71449f8c4bb", + ] +} + +provider "registry.terraform.io/hashicorp/kubernetes" { + version = "2.4.1" + constraints = "2.4.1" + hashes = [ + "h1:RpE4kNQYkGxIyHyIEHXcdt/vKCtTVU2NNzTrOK4hb9E=", + "zh:10a368f3a3f26d821f02b55f0c42bdd4d2cd0dc5e2568c513bce39d92d25526f", + "zh:2183272a6d44f23d562d47ff4d6592685d8797838bdae69a50f92121743b020f", + "zh:24c492d61ce4dbcac4bb4410bd5e657ab28d19ab320d41104148ee626b44f5ed", + "zh:291380db0cd581d806158e5ddfd7133592055151109fcf0c923644cede5f30c7", + "zh:46933ddae44108d1a2956d917bafdb8879147b204b1bfac0c238773d2587e288", + "zh:5b96c1c330d709d87faa44f1cc9b1db87baeba5056638fe07c51a9b5a67f297e", + "zh:9fbb4ac6de96f68df324adbb77fd5eee6138f534f5393dc3bac18e615c75e0d0", + "zh:b8da6bbb97c20ec6e26c0160060c24d4e91b5057342b8b93a43f4019ab36e344", + "zh:c12390d668ef2f4c943c385de3befb54c0bfd0f9a3aa28b6aec55f7db4f4a518", + "zh:dee3d13f664037ada51e6f51c7e1c1361e643e1e61fbc9403b0f3985caa29c90", + "zh:ed10c04a636fa4a0f6e5e6068cb2f9a0f976b596cbabb9bd429631e3ba7fa35a", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.1.0" + constraints = "3.1.0" + hashes = [ + "h1:xhbHC6in3nQryvTQBWKxebi3inG5OCgHgc4fRxL0ymc=", + "zh:02a1675fd8de126a00460942aaae242e65ca3380b5bb192e8773ef3da9073fd2", + "zh:53e30545ff8926a8e30ad30648991ca8b93b6fa496272cd23b26763c8ee84515", + "zh:5f9200bf708913621d0f6514179d89700e9aa3097c77dac730e8ba6e5901d521", + "zh:9ebf4d9704faba06b3ec7242c773c0fbfe12d62db7d00356d4f55385fc69bfb2", + "zh:a6576c81adc70326e4e1c999c04ad9ca37113a6e925aefab4765e5a5198efa7e", + "zh:a8a42d13346347aff6c63a37cda9b2c6aa5cc384a55b2fe6d6adfa390e609c53", + "zh:c797744d08a5307d50210e0454f91ca4d1c7621c68740441cf4579390452321d", + "zh:cecb6a304046df34c11229f20a80b24b1603960b794d68361a67c5efe58e62b8", + "zh:e1371aa1e502000d9974cfaff5be4cfa02f47b17400005a16f14d2ef30dc2a70", + "zh:fc39cc1fe71234a0b0369d5c5c7f876c71b956d23d7d6f518289737a001ba69b", + "zh:fea4227271ebf7d9e2b61b89ce2328c7262acd9fd190e1fd6d15a591abfa848e", + ] +} diff --git a/main.tf b/main.tf index def4a05..1b2f87d 100644 --- a/main.tf +++ b/main.tf @@ -35,5 +35,7 @@ module "k3s" { gloo_num_nodes = each.value.num_nodes gloo_target_nodes_size = each.value.target_nodes_size gloo_role = each.value.role - applications = each.value.apps -} \ No newline at end of file + # applications = each.value.apps + gloo_apps = [] + gloo_clusterz = var.gloo_clusters +} diff --git a/modules/k3s/main.tf b/modules/k3s/main.tf index 70e423d..f8ffddb 100644 --- a/modules/k3s/main.tf +++ b/modules/k3s/main.tf @@ -1,3 +1,8 @@ +variable "gloo_clusterz" { + type = map(any) + description = "Gloo Clusters" +} + variable gloo_name { type = string description = "description" @@ -37,13 +42,13 @@ data "civo_kubernetes_version" "stable" { } resource "civo_kubernetes_cluster" "gloo" { - for_each = var.gloo_clusters + for_each = var.gloo_clusterz name = "gloo-${var.gloo_name}" - region = gloo_region - num_target_nodes = gloo_num_nodes - target_nodes_size = gloo_target_nodes_size - tags = join(",", ["gloo",gloo_role]) - applications = join(",", gloo_apps) + region = var.gloo_region + num_target_nodes = var.gloo_num_nodes + target_nodes_size = var.gloo_target_nodes_size + tags = join(",", ["gloo",var.gloo_role]) + applications = join(",", var.gloo_apps) kubernetes_version = element(data.civo_kubernetes_version.stable.versions, 0).version -} \ No newline at end of file +} diff --git a/modules/k3s/provider.tf b/modules/k3s/provider.tf new file mode 100644 index 0000000..34cfb33 --- /dev/null +++ b/modules/k3s/provider.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + civo = { + source = "civo/civo" + version = "0.10.9" + } + } +} diff --git a/variables.tf b/variables.tf index d2688d1..f9515d6 100644 --- a/variables.tf +++ b/variables.tf @@ -16,4 +16,4 @@ variable "gloo_clusters" { apps = ["-Traefik"] } } -} \ No newline at end of file +} diff --git a/versions.tf b/versions.tf index 532b45f..abba965 100644 --- a/versions.tf +++ b/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { civo = { - source = "civo/civo" + source = "civo/civo" version = "0.10.9" }