From f7b1cc5ad06ee2774a55d178b905a2668f0c4269 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Wed, 10 Nov 2021 12:22:29 +0600 Subject: [PATCH 1/7] enh: updated terraform, terragrunt, providers #174 --- terraform/.terraform-version | 3 +- terraform/.terragrunt-version | 2 +- terraform/layer1-aws/.terraform.lock.hcl | 58 ++++++++-------- terraform/layer1-aws/main.tf | 6 +- terraform/layer2-k8s/.terraform.lock.hcl | 87 ++++++++++++------------ terraform/layer2-k8s/main.tf | 8 +-- terraform/terragrunt.hcl | 5 +- 7 files changed, 81 insertions(+), 88 deletions(-) diff --git a/terraform/.terraform-version b/terraform/.terraform-version index 232f96fd..7ee7020b 100644 --- a/terraform/.terraform-version +++ b/terraform/.terraform-version @@ -1,2 +1 @@ -0.15.1 - +1.0.10 diff --git a/terraform/.terragrunt-version b/terraform/.terragrunt-version index 20f06870..0a4258d4 100644 --- a/terraform/.terragrunt-version +++ b/terraform/.terragrunt-version @@ -1 +1 @@ -0.29.2 +0.35.8 diff --git a/terraform/layer1-aws/.terraform.lock.hcl b/terraform/layer1-aws/.terraform.lock.hcl index 780fb203..5b41db55 100644 --- a/terraform/layer1-aws/.terraform.lock.hcl +++ b/terraform/layer1-aws/.terraform.lock.hcl @@ -2,22 +2,21 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/aws" { - version = "3.53.0" - constraints = ">= 2.49.0, >= 2.53.0, >= 3.15.0, >= 3.40.0, >= 3.43.0, 3.53.0" + version = "3.64.2" + constraints = ">= 2.49.0, >= 2.53.0, >= 3.15.0, >= 3.40.0, >= 3.43.0, 3.64.2" hashes = [ - "h1:kcda9YVaFUzBFVtKXNZrQB801i2XkH1Y5gbdOHNpB38=", - "h1:oRCCzfwGCDNyuhIJ8kCg0N7h4W2WESm37o2GIt0ETpQ=", - "zh:35a77c79170b0cf3fb7eb835f3ce0b715aeeceda0a259e96e49fed5a30cf6646", - "zh:519d5470a932b1ec9a0fe08876c5e0f0f84f8e506b652c051e4ab708be081e89", - "zh:58cfa5b454602d57c47acd15c2ad166a012574742cdbcf950787ce79b6510218", - "zh:5fc3c0162335a730701c0175809250233f45f1021da8fa52c73635e4c08372d8", - "zh:6790f9d6261eb4bd5cdd7cd9125f103befce2ba127f9ba46eef83585b86e1d11", - "zh:76e1776c3bf9568d520f78419ec143c081f653b8df4fb22577a8c4a35d3315f9", - "zh:ca8ed88d0385e45c35223ace59b1bf77d81cd2154d5416e63a3dddaf0def30e6", - "zh:d002562c4a89a9f1f6cd8d854fad3c66839626fc260e5dde5267f6d34dbd97a4", - "zh:da5e47fb769e90a2f16c90fd0ba95d62da3d76eb006823664a5c6e96188731b0", - "zh:dfe7f33ec252ea550e090975a5f10940c27302bebb5559957957937b069646ea", - "zh:fa91574605ddce726e8a4e421297009a9dabe023106e139ac46da49c8285f2fe", + "h1:eXusrZ56Ye4gprLzI3dXBy50DV+sbY5gOoJ7cNuouzA=", + "zh:0b029a2282beabfe410eb2969e18ca773d3473415e442be4dc8ce0eb6d1cd8c5", + "zh:3209de3266a1138f1ccb09f094fdd98b6f55afc06e291db0abe092ec5dbe7640", + "zh:40648266551631cbc15f8a76e80faf300510e3b38c2544d43fc25e37e6802727", + "zh:483c8af92ae70146f2790a70c1a810251e7135aa912b66e769c934eddceebe32", + "zh:4d106d8d415d8df342f3f85e58c35418e6c55e3cb7f02897f832cefac4dca68c", + "zh:972626a6ddb31d5216606d12ab5c30fbf8d51ed2bbe0efcdd7cffa68c1141557", + "zh:a230d55ec52b1695148d40296877ee23e0b302e817154f9b838eb117c87b13fa", + "zh:c95fddfbd7f870db949da0601323e866e0f0fb0d4a93e96725ae5b88029e84d5", + "zh:ea0c7f568074f835f22273c8e7e61e87f5277e32004c72122915fd3c8df49ccc", + "zh:f96d25887e6e2d2ae47659e2c586efea2167995b59a479ae65a02b097da86474", + "zh:fe7502d8e52d3b5ccb2b3c178e7ea894344783093aa71ffb20e978914c976182", ] } @@ -41,22 +40,21 @@ provider "registry.terraform.io/hashicorp/cloudinit" { } provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.4.1" - constraints = ">= 1.11.1, 2.4.1" + version = "2.6.1" + constraints = ">= 1.11.1, 2.6.1" hashes = [ - "h1:RpE4kNQYkGxIyHyIEHXcdt/vKCtTVU2NNzTrOK4hb9E=", - "h1:wU6cDBN6KPhjbBvPWXRgryN9amNlhL/n9l39cFm3X/U=", - "zh:10a368f3a3f26d821f02b55f0c42bdd4d2cd0dc5e2568c513bce39d92d25526f", - "zh:2183272a6d44f23d562d47ff4d6592685d8797838bdae69a50f92121743b020f", - "zh:24c492d61ce4dbcac4bb4410bd5e657ab28d19ab320d41104148ee626b44f5ed", - "zh:291380db0cd581d806158e5ddfd7133592055151109fcf0c923644cede5f30c7", - "zh:46933ddae44108d1a2956d917bafdb8879147b204b1bfac0c238773d2587e288", - "zh:5b96c1c330d709d87faa44f1cc9b1db87baeba5056638fe07c51a9b5a67f297e", - "zh:9fbb4ac6de96f68df324adbb77fd5eee6138f534f5393dc3bac18e615c75e0d0", - "zh:b8da6bbb97c20ec6e26c0160060c24d4e91b5057342b8b93a43f4019ab36e344", - "zh:c12390d668ef2f4c943c385de3befb54c0bfd0f9a3aa28b6aec55f7db4f4a518", - "zh:dee3d13f664037ada51e6f51c7e1c1361e643e1e61fbc9403b0f3985caa29c90", - "zh:ed10c04a636fa4a0f6e5e6068cb2f9a0f976b596cbabb9bd429631e3ba7fa35a", + "h1:DWgawNO2C7IuXC2v9IjTSsqs1vZHSAbP4ilWQ0LdbwI=", + "zh:081fbaf9441ebb278753dcf05f318fa7d445e9599a600d7c525e9a18b871d4c8", + "zh:143bfbe871c628981d756ead47486e807fce876232d05607e0b8852ebee4eed8", + "zh:34f413a644eb952e3f041d67ef19200f4c286d374eae87b60fafdd8bf6bb5654", + "zh:370562be70233be730e1876d565710c3ef477e047f209cb3dff8a4a3217a6461", + "zh:443021df6d56e59e4d8dda8e57b506affff32b8a22de09661d21b98bc781fefb", + "zh:51a9501360b58adf9ee6e09fb81f555042ebc909ab36e06ccfc5e701e91f9923", + "zh:7d41d48b8291b98e0a4b7a1f79a9d1fe140a2e0d8df422c5b48cbae4c3fa615a", + "zh:881b3e44814d7d49a5820e2e4b13ee3d000b5baf7957df774a909f17472ece8a", + "zh:b860ff68a944de63fbe0a624c41f2e373711a2da4298c0f0cb151e00fb32a6b3", + "zh:c4ab48ea6e0f8d4a6db1abab1877addb2b21ecd126e505c74b8c85804bd92cbe", + "zh:e96589575dfd31eab48fcc85466dd49895925473c60c802b346cdb4037953350", ] } diff --git a/terraform/layer1-aws/main.tf b/terraform/layer1-aws/main.tf index 1ff4c18a..c9b789cc 100644 --- a/terraform/layer1-aws/main.tf +++ b/terraform/layer1-aws/main.tf @@ -1,14 +1,14 @@ terraform { - required_version = "0.15.1" + required_version = "1.0.10" required_providers { aws = { source = "aws" - version = "3.53.0" + version = "3.64.2" } kubernetes = { source = "kubernetes" - version = "2.4.1" + version = "2.6.1" } } } diff --git a/terraform/layer2-k8s/.terraform.lock.hcl b/terraform/layer2-k8s/.terraform.lock.hcl index 6a61ab29..514c291b 100644 --- a/terraform/layer2-k8s/.terraform.lock.hcl +++ b/terraform/layer2-k8s/.terraform.lock.hcl @@ -2,22 +2,21 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/aws" { - version = "3.53.0" - constraints = "3.53.0" + version = "3.64.2" + constraints = "3.64.2" hashes = [ - "h1:kcda9YVaFUzBFVtKXNZrQB801i2XkH1Y5gbdOHNpB38=", - "h1:oRCCzfwGCDNyuhIJ8kCg0N7h4W2WESm37o2GIt0ETpQ=", - "zh:35a77c79170b0cf3fb7eb835f3ce0b715aeeceda0a259e96e49fed5a30cf6646", - "zh:519d5470a932b1ec9a0fe08876c5e0f0f84f8e506b652c051e4ab708be081e89", - "zh:58cfa5b454602d57c47acd15c2ad166a012574742cdbcf950787ce79b6510218", - "zh:5fc3c0162335a730701c0175809250233f45f1021da8fa52c73635e4c08372d8", - "zh:6790f9d6261eb4bd5cdd7cd9125f103befce2ba127f9ba46eef83585b86e1d11", - "zh:76e1776c3bf9568d520f78419ec143c081f653b8df4fb22577a8c4a35d3315f9", - "zh:ca8ed88d0385e45c35223ace59b1bf77d81cd2154d5416e63a3dddaf0def30e6", - "zh:d002562c4a89a9f1f6cd8d854fad3c66839626fc260e5dde5267f6d34dbd97a4", - "zh:da5e47fb769e90a2f16c90fd0ba95d62da3d76eb006823664a5c6e96188731b0", - "zh:dfe7f33ec252ea550e090975a5f10940c27302bebb5559957957937b069646ea", - "zh:fa91574605ddce726e8a4e421297009a9dabe023106e139ac46da49c8285f2fe", + "h1:eXusrZ56Ye4gprLzI3dXBy50DV+sbY5gOoJ7cNuouzA=", + "zh:0b029a2282beabfe410eb2969e18ca773d3473415e442be4dc8ce0eb6d1cd8c5", + "zh:3209de3266a1138f1ccb09f094fdd98b6f55afc06e291db0abe092ec5dbe7640", + "zh:40648266551631cbc15f8a76e80faf300510e3b38c2544d43fc25e37e6802727", + "zh:483c8af92ae70146f2790a70c1a810251e7135aa912b66e769c934eddceebe32", + "zh:4d106d8d415d8df342f3f85e58c35418e6c55e3cb7f02897f832cefac4dca68c", + "zh:972626a6ddb31d5216606d12ab5c30fbf8d51ed2bbe0efcdd7cffa68c1141557", + "zh:a230d55ec52b1695148d40296877ee23e0b302e817154f9b838eb117c87b13fa", + "zh:c95fddfbd7f870db949da0601323e866e0f0fb0d4a93e96725ae5b88029e84d5", + "zh:ea0c7f568074f835f22273c8e7e61e87f5277e32004c72122915fd3c8df49ccc", + "zh:f96d25887e6e2d2ae47659e2c586efea2167995b59a479ae65a02b097da86474", + "zh:fe7502d8e52d3b5ccb2b3c178e7ea894344783093aa71ffb20e978914c976182", ] } @@ -40,42 +39,40 @@ provider "registry.terraform.io/hashicorp/external" { } provider "registry.terraform.io/hashicorp/helm" { - version = "2.2.0" - constraints = "2.2.0" + version = "2.4.1" + constraints = "2.4.1" hashes = [ - "h1:liBgOoOXhA2A1DbL0oaifyNnoGOyHxMG4+xD1Kl58XA=", - "h1:rxDS2QQuG/M9aRSKlvW2oHsp5eGAoB1J9KZthCOVbeQ=", - "zh:01341dd1e9cc7e7f6999e11e7473bcdca2dd72dd27f91beed1f4fb599a15dfba", - "zh:20e86c9eccd3a81ef5ac243af31b61fc4d2d679437384bd0870e92fa1b3ed6c9", - "zh:22a71127c5dbea4f62edb5bcf00b5c163de04aa19d45a7a1f621f973ffd09d20", - "zh:28ab7c84a5f8ed82fc520668db93d650571ddf59d98845cb18a1fa1a7888efc0", - "zh:3985a30929ad8fdc6b94f0e1cbd62a63db75ee961b8ba7db1cf4bfd29e8009ff", - "zh:477d92e26ba0c906087a5dd827ac3917dad7d5af770ee0ab4b08d0f273150586", - "zh:750928ec5ef54b2090bd6a6d8a19630a8712bbbccc0429251e88ccd361c1d3c0", - "zh:a615841fd90094bddc1269127e501fa60453c441b9548ff73752fe14efc38ed0", - "zh:e762aca7883374fa255efba50f5bdf791fece7d61e3920e593fb1a2cbb598981", - "zh:f76f372ead52948ca53610b371cb80c80ebcf058ef0a5c0ce9f0ce38dcc9a8eb", - "zh:fa36fe93ed977f4478cc6547ec3c45c28e56f10632e85446b0c3d71449f8c4bb", + "h1:CLb4n9f/hLyqqq0zbc+h5SuNOB7KnO65qOOb+ohwsKA=", + "zh:07517b24ea2ce4a1d3be3b88c3efc7fb452cd97aea8fac93ca37a08a8ec06e14", + "zh:11ef6118ed03a1b40ff66adfe21b8707ece0568dae1347ddfbcff8452c0655d5", + "zh:1ae07e9cc6b088a6a68421642c05e2fa7d00ed03e9401e78c258cf22a239f526", + "zh:1c5b4cd44033a0d7bf7546df930c55aa41db27b70b3bca6d145faf9b9a2da772", + "zh:256413132110ddcb0c3ea17c7b01123ad2d5b70565848a77c5ccc22a3f32b0dd", + "zh:4ab46fd9aadddef26604382bc9b49100586647e63ef6384e0c0c3f010ff2f66e", + "zh:5a35d23a9f08c36fceda3cef7ce2c7dc5eca32e5f36494de695e09a5007122f0", + "zh:8e9823a1e5b985b63fe283b755a821e5011a58112447d42fb969c7258ed57ed3", + "zh:8f79722eba9bf77d341edf48a1fd51a52d93ec31d9cac9ba8498a3a061ea4a7f", + "zh:b2ea782848b10a343f586ba8ee0cf4d7ff65aa2d4b144eea5bbd8f9801b54c67", + "zh:e72d1ccf8a75d8e8456c6bb4d843fd4deb0e962ad8f167fa84cf17f12c12304e", ] } provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.4.1" - constraints = "2.4.1" + version = "2.6.1" + constraints = "2.6.1" hashes = [ - "h1:RpE4kNQYkGxIyHyIEHXcdt/vKCtTVU2NNzTrOK4hb9E=", - "h1:wU6cDBN6KPhjbBvPWXRgryN9amNlhL/n9l39cFm3X/U=", - "zh:10a368f3a3f26d821f02b55f0c42bdd4d2cd0dc5e2568c513bce39d92d25526f", - "zh:2183272a6d44f23d562d47ff4d6592685d8797838bdae69a50f92121743b020f", - "zh:24c492d61ce4dbcac4bb4410bd5e657ab28d19ab320d41104148ee626b44f5ed", - "zh:291380db0cd581d806158e5ddfd7133592055151109fcf0c923644cede5f30c7", - "zh:46933ddae44108d1a2956d917bafdb8879147b204b1bfac0c238773d2587e288", - "zh:5b96c1c330d709d87faa44f1cc9b1db87baeba5056638fe07c51a9b5a67f297e", - "zh:9fbb4ac6de96f68df324adbb77fd5eee6138f534f5393dc3bac18e615c75e0d0", - "zh:b8da6bbb97c20ec6e26c0160060c24d4e91b5057342b8b93a43f4019ab36e344", - "zh:c12390d668ef2f4c943c385de3befb54c0bfd0f9a3aa28b6aec55f7db4f4a518", - "zh:dee3d13f664037ada51e6f51c7e1c1361e643e1e61fbc9403b0f3985caa29c90", - "zh:ed10c04a636fa4a0f6e5e6068cb2f9a0f976b596cbabb9bd429631e3ba7fa35a", + "h1:DWgawNO2C7IuXC2v9IjTSsqs1vZHSAbP4ilWQ0LdbwI=", + "zh:081fbaf9441ebb278753dcf05f318fa7d445e9599a600d7c525e9a18b871d4c8", + "zh:143bfbe871c628981d756ead47486e807fce876232d05607e0b8852ebee4eed8", + "zh:34f413a644eb952e3f041d67ef19200f4c286d374eae87b60fafdd8bf6bb5654", + "zh:370562be70233be730e1876d565710c3ef477e047f209cb3dff8a4a3217a6461", + "zh:443021df6d56e59e4d8dda8e57b506affff32b8a22de09661d21b98bc781fefb", + "zh:51a9501360b58adf9ee6e09fb81f555042ebc909ab36e06ccfc5e701e91f9923", + "zh:7d41d48b8291b98e0a4b7a1f79a9d1fe140a2e0d8df422c5b48cbae4c3fa615a", + "zh:881b3e44814d7d49a5820e2e4b13ee3d000b5baf7957df774a909f17472ece8a", + "zh:b860ff68a944de63fbe0a624c41f2e373711a2da4298c0f0cb151e00fb32a6b3", + "zh:c4ab48ea6e0f8d4a6db1abab1877addb2b21ecd126e505c74b8c85804bd92cbe", + "zh:e96589575dfd31eab48fcc85466dd49895925473c60c802b346cdb4037953350", ] } diff --git a/terraform/layer2-k8s/main.tf b/terraform/layer2-k8s/main.tf index 5f7994ef..13b05500 100644 --- a/terraform/layer2-k8s/main.tf +++ b/terraform/layer2-k8s/main.tf @@ -1,18 +1,18 @@ terraform { - required_version = "0.15.1" + required_version = "1.0.10" required_providers { aws = { source = "aws" - version = "3.53.0" + version = "3.64.2" } kubernetes = { source = "kubernetes" - version = "2.4.1" + version = "2.6.1" } helm = { source = "helm" - version = "2.2.0" + version = "2.4.1" } } } diff --git a/terraform/terragrunt.hcl b/terraform/terragrunt.hcl index 187d8e7c..fcab7c92 100644 --- a/terraform/terragrunt.hcl +++ b/terraform/terragrunt.hcl @@ -18,10 +18,9 @@ remote_state { region = local.region bucket = local.remote_state_bucket key = "${path_relative_to_include()}/terraform.tfstate" - dynamodb_table = "${local.remote_state_bucket}-${path_relative_to_include()}" + # dynamodb_table = "${local.remote_state_bucket}-${path_relative_to_include()}" encrypt = true } } -terragrunt_version_constraint = "0.29.2" - +terragrunt_version_constraint = "0.35.8" From f8f5e6305efc6852a8110f040fa3a287cdba4ec5 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Wed, 10 Nov 2021 13:16:54 +0600 Subject: [PATCH 2/7] doc: change license to Apache 2.0 License #175 --- LICENSE.md | 197 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 176 insertions(+), 21 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 0d97ac91..d0381d6d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,21 +1,176 @@ -The MIT License (MIT) - -Copyright (c) 2020 Mad Devs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS From 8d7f69b8d95d633e3023afa492745a2871ddd834 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Wed, 10 Nov 2021 14:05:12 +0600 Subject: [PATCH 3/7] enh: updated modules versions in layer1 #174 --- terraform/layer1-aws/aws-eks.tf | 2 +- terraform/layer1-aws/aws-r53.tf | 2 +- terraform/layer1-aws/aws-vpc-endpoints.tf | 2 +- terraform/layer1-aws/aws-vpc.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform/layer1-aws/aws-eks.tf b/terraform/layer1-aws/aws-eks.tf index 6033d12c..4197da01 100644 --- a/terraform/layer1-aws/aws-eks.tf +++ b/terraform/layer1-aws/aws-eks.tf @@ -26,7 +26,7 @@ locals { #tfsec:ignore:aws-vpc-no-public-egress-sgr tfsec:ignore:aws-eks-enable-control-plane-logging tfsec:ignore:aws-eks-encrypt-secrets tfsec:ignore:aws-eks-no-public-cluster-access tfsec:ignore:aws-eks-no-public-cluster-access-to-cidr module "eks" { source = "terraform-aws-modules/eks/aws" - version = "17.3.0" + version = "17.23.0" cluster_name = local.name cluster_version = var.eks_cluster_version diff --git a/terraform/layer1-aws/aws-r53.tf b/terraform/layer1-aws/aws-r53.tf index 5ed3c54f..c088945c 100644 --- a/terraform/layer1-aws/aws-r53.tf +++ b/terraform/layer1-aws/aws-r53.tf @@ -1,6 +1,6 @@ module "r53_zone" { source = "terraform-aws-modules/route53/aws//modules/zones" - version = "2.1.0" + version = "2.3.0" create = var.create_r53_zone diff --git a/terraform/layer1-aws/aws-vpc-endpoints.tf b/terraform/layer1-aws/aws-vpc-endpoints.tf index 79834350..22898d36 100644 --- a/terraform/layer1-aws/aws-vpc-endpoints.tf +++ b/terraform/layer1-aws/aws-vpc-endpoints.tf @@ -7,7 +7,7 @@ data "aws_security_group" "default" { module "vpc_gateway_endpoints" { source = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints" - version = "3.2.0" + version = "3.11.0" vpc_id = module.vpc.vpc_id diff --git a/terraform/layer1-aws/aws-vpc.tf b/terraform/layer1-aws/aws-vpc.tf index fdf9478b..abb73bc4 100644 --- a/terraform/layer1-aws/aws-vpc.tf +++ b/terraform/layer1-aws/aws-vpc.tf @@ -9,7 +9,7 @@ locals { module "vpc" { source = "terraform-aws-modules/vpc/aws" - version = "3.2.0" + version = "3.11.0" name = local.name cidr = var.cidr From d1285627555b132c7e792f59291c705b591a774e Mon Sep 17 00:00:00 2001 From: Andrew S Date: Wed, 10 Nov 2021 15:31:58 +0600 Subject: [PATCH 4/7] enh: added command to get grafana admin password to outputs #60 --- terraform/layer2-k8s/eks-kube-prometheus-stack.tf | 5 +++++ terraform/layer2-k8s/templates/prometheus-values.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/terraform/layer2-k8s/eks-kube-prometheus-stack.tf b/terraform/layer2-k8s/eks-kube-prometheus-stack.tf index 742c7315..d108da0c 100644 --- a/terraform/layer2-k8s/eks-kube-prometheus-stack.tf +++ b/terraform/layer2-k8s/eks-kube-prometheus-stack.tf @@ -193,3 +193,8 @@ output "grafana_admin_password" { sensitive = true description = "Grafana admin password" } + +output "get_grafana_admin_password" { + value = "kubectl get secret --namespace monitoring kube-prometheus-stack-grafana -o jsonpath='{.data.admin-password}' | base64 --decode ; echo" + description = "Command which gets admin password from kubernetes secret" +} diff --git a/terraform/layer2-k8s/templates/prometheus-values.yaml b/terraform/layer2-k8s/templates/prometheus-values.yaml index d84df0ee..afc3cf09 100644 --- a/terraform/layer2-k8s/templates/prometheus-values.yaml +++ b/terraform/layer2-k8s/templates/prometheus-values.yaml @@ -79,7 +79,7 @@ grafana: GF_AUTH_GITLAB_ALLOW_SIGN_UP: "true" GF_AUTH_GITLAB_CLIENT_ID: "${gitlab_client_id}" GF_AUTH_GITLAB_CLIENT_SECRET: "${gitlab_client_secret}" - GF_AUTH_GITLAB_SCOPES: "api" + GF_AUTH_GITLAB_SCOPES: "read_api" GF_AUTH_GITLAB_AUTH_URL: "https://gitlab.com/oauth/authorize" GF_AUTH_GITLAB_TOKEN_URL: "https://gitlab.com/oauth/token" GF_AUTH_GITLAB_API_URL: "https://gitlab.com/api/v4" From 00804e5a45c11af0bbf53cb79b566a4038feb371 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Wed, 10 Nov 2021 15:35:19 +0600 Subject: [PATCH 5/7] doc: updated layers README.md #60 --- terraform/layer1-aws/README.md | 16 ++++++++----- terraform/layer2-k8s/README.md | 43 ++++++++++++++-------------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/terraform/layer1-aws/README.md b/terraform/layer1-aws/README.md index 5a78d748..39964db4 100644 --- a/terraform/layer1-aws/README.md +++ b/terraform/layer1-aws/README.md @@ -2,20 +2,26 @@ | Name | Version | |------|---------| -| terraform | 0.15.1 | -| aws | 3.53.0 | -| kubernetes | 2.4.1 | +| terraform | 1.0.10 | +| aws | 3.64.2 | +| kubernetes | 2.6.1 | ## Providers | Name | Version | |------|---------| -| aws | 3.53.0 | +| aws | 3.64.2 | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| addon\_coredns\_version | The version of coredns add-on | `string` | `"v1.8.3-eksbuild.1"` | no | +| addon\_create\_coredns | Enable coredns add-on or not | `bool` | `true` | no | +| addon\_create\_kube\_proxy | Enable kube-proxy add-on or not | `bool` | `true` | no | +| addon\_create\_vpc\_cni | Enable vpc-cni add-on or not | `bool` | `true` | no | +| addon\_kube\_proxy\_version | The version of kube-proxy add-on | `string` | `"v1.20.4-eksbuild.2"` | no | +| addon\_vpc\_cni\_version | The version of vpc-cni add-on | `string` | `"v1.9.1-eksbuild.1"` | no | | allowed\_account\_ids | List of allowed AWS account IDs | `list` | `[]` | no | | allowed\_ips | IP addresses allowed to connect to private resources | `list(any)` | `[]` | no | | az\_count | Count of avaiablity zones, min 2 | `number` | `3` | no | @@ -23,8 +29,6 @@ | create\_acm\_certificate | Whether to create acm certificate or use existing | `bool` | `false` | no | | create\_r53\_zone | Create R53 zone for main public domain | `bool` | `false` | no | | domain\_name | Main public domain name | `any` | n/a | yes | -| ecr\_repo\_retention\_count | number of images to store in ECR | `number` | `50` | no | -| ecr\_repos | List of docker repositories | `list(any)` |
[
"demo"
]
| no | | eks\_cluster\_enabled\_log\_types | A list of the desired control plane logging to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html). Possible values: api, audit, authenticator, controllerManager, scheduler | `list(string)` |
[
"audit"
]
| no | | eks\_cluster\_encryption\_config\_enable | Enable or not encryption for k8s secrets with aws-kms | `bool` | `false` | no | | eks\_cluster\_log\_retention\_in\_days | Number of days to retain log events. Default retention - 90 days. | `number` | `90` | no | diff --git a/terraform/layer2-k8s/README.md b/terraform/layer2-k8s/README.md index 1851c079..30c3bf11 100644 --- a/terraform/layer2-k8s/README.md +++ b/terraform/layer2-k8s/README.md @@ -2,18 +2,18 @@ | Name | Version | |------|---------| -| terraform | 0.15.1 | -| aws | 3.38.0 | -| helm | 2.1.2 | -| kubernetes | 2.1.0 | +| terraform | 1.0.10 | +| aws | 3.64.2 | +| helm | 2.4.1 | +| kubernetes | 2.6.1 | ## Providers | Name | Version | |------|---------| -| aws | 3.38.0 | -| helm | 2.1.2 | -| kubernetes | 2.1.0 | +| aws | 3.64.2 | +| helm | 2.4.1 | +| random | n/a | | template | n/a | | terraform | n/a | @@ -22,33 +22,24 @@ | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | additional\_allowed\_ips | IP addresses allowed to connect to private resources | `list(any)` | `[]` | no | -| alb\_ingress\_chart\_version | Version of alb-ingress helm chart | `string` | `"1.0.4"` | no | -| alb\_ingress\_image\_tag | Tag of docker image for alb-ingress controller | `string` | `"v1.1.5"` | no | | allowed\_account\_ids | List of allowed AWS account IDs | `list` | `[]` | no | -| aws\_node\_termination\_handler\_version | Version of aws-node-termination-handler helm chart | `string` | `"0.13.3"` | no | -| calico\_daemonset | Version of calico helm chart | `string` | `"0.3.4"` | no | -| cert\_manager\_version | Version of cert-manager helm chart | `string` | `"1.1.0"` | no | -| cluster\_autoscaler\_chart\_version | Version of cluster autoscaler helm chart | `string` | `"9.9.2"` | no | -| cluster\_autoscaler\_version | Version of cluster autoscaler | `string` | `"v1.19.0"` | no | +| aws\_loadbalancer\_controller\_enable | Disable or Enable aws-loadbalancer-controller. You need to enable it if you want to use Fargate | `bool` | `false` | no | +| cluster\_autoscaler\_version | Version of cluster autoscaler | `string` | `"v1.21.0"` | no | | elk\_index\_retention\_days | Days before remove index from system elasticsearch | `number` | `14` | no | | elk\_snapshot\_retention\_days | Days to capture index in snapshot | `number` | `90` | no | -| elk\_version | Version of ELK helm chart | `string` | `"7.8.0"` | no | -| external\_dns\_version | Version of external-dns helm chart | `string` | `"4.9.4"` | no | -| external\_secrets\_version | Version of external-secrets helm chart | `string` | `"6.3.0"` | no | -| gitlab\_runner\_version | Version of gitlab runner helm chart | `string` | `"0.26.0"` | no | -| loki\_stack | Version of Loki Stack helm chart | `string` | `"2.3.1"` | no | -| nginx\_ingress\_controller\_version | Version of nginx-ingress helm chart | `string` | `"3.23.0"` | no | +| helm\_release\_history\_size | How much helm releases to store | `number` | `5` | no | | nginx\_ingress\_ssl\_terminator | Select SSL termination type | `string` | `"lb"` | no | -| oauth2\_proxy\_version | Version of the oauth-proxy chart | `string` | `"3.2.5"` | no | -| prometheus\_mysql\_exporter\_version | Version of prometheus mysql-exporter helm chart | `string` | `"1.1.0"` | no | -| prometheus\_operator\_version | Version of prometheus operator helm chart | `string` | `"13.12.0"` | no | -| redis\_version | Version of redis helm chart | `string` | `"12.7.3"` | no | | region | Default infrastructure region | `string` | `"us-east-1"` | no | -| reloader\_version | Version of reloader helm chart | `string` | `"0.0.81"` | no | | remote\_state\_bucket | Name of the bucket for terraform state | `string` | n/a | yes | | remote\_state\_key | Key of the remote state for terraform\_remote\_state | `string` | `"layer1-aws"` | no | ## Outputs -No output. +| Name | Description | +|------|-------------| +| alertmanager\_domain\_name | Alertmanager ui address | +| get\_grafana\_admin\_password | Command which gets admin password from kubernetes secret | +| grafana\_admin\_password | Grafana admin password | +| grafana\_domain\_name | Grafana dashboards address | +| prometheus\_domain\_name | Prometheus ui address | From 060f488b6af3b787f6e87ab2d4e09b93940c4350 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Wed, 10 Nov 2021 15:36:59 +0600 Subject: [PATCH 6/7] doc: updated README.md #60 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c0ff5354..33439d4b 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ In the root of `layer2-k8s` is the `aws-sm-secrets.tf` where several local varia } ``` -> Set proper secrets; you can set empty/mock values. If you won't use these secrets, delete this `.tf` file from the `layer2-k8s` root. +> Set proper secrets; you also can set empty/mock values. #### Domain and SSL @@ -460,7 +460,7 @@ Each layer has an `examples/` directory that contains working examples that expa This will allow you to expand your basic functionality by launching a monitoring system based on ELK or Prometheus Stack, etc. -* If you want to deploy **`ELK stack`**, move `layer1-aws/examples/aws-s3-bucket-elastic-stack.tf` and `layer2-k8s/examples/eks-elk.tf` to the root of the layers. +* If you want to deploy **`ELK stack`**, move `layer1-aws/examples/aws-s3-bucket-elastic-stack.tf` and `layer2-k8s/examples/eks-elk.tf` to the root of the layers. * If you want to deploy **`Pritunl VPN`** server just move `layer1-aws/examples/aws-ec2-pritunl.tf` to the root of the layer. * If you want to deploy **`Gitlab runner`** that runs workers as k8s pods (in EKS cluster), move `layer1-aws/examples/aws-s3-bucket-gitlab-runner-cache.tf` and `layer2-k8s/examples/eks-gitlab-runner.tf` to the root of the layers. * If you want to deploy `Istio Operator` move `layer2-k8s/examples/eks-istio.tf` to the root of the layer. From e94e06ad796cba004f89007366e4693bd7bf4702 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Wed, 10 Nov 2021 15:42:58 +0600 Subject: [PATCH 7/7] doc: updated README.md #60 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 33439d4b..2242033c 100644 --- a/README.md +++ b/README.md @@ -383,7 +383,7 @@ terragrunt apply #### Target apply by `terragrunt` -Go to layer folder `terraform/layer1-aws/` or `terraform/layer2-k8s/` and run this command: +Go to layer folder `terraform/layer1-aws/` and run this command: ``` terragrunt apply -target=module.eks @@ -400,14 +400,14 @@ To destroy both layers, run this command from `terraform/` folder: terragrant run-all destroy ``` -To destroy `layer2-k8s`, run this command from `terraform/layare2-k8s` folder: +> The `layer2-k8s` depends on `layer1-aws`, so `layer2-k8s` will be destroyed automatically first. + +If you want to destroy layers manually, then destroy `layer2-k8s` first, ie run this command from `terraform/layare2-k8s` folder: ``` terragrunt destroy ``` -> The `layer2-k8s` has dependence from `layer1-aws` and when you destroy `layer1-aws`, `layer2-k8s` destroyed automatically. - ## What to do after deployment After applying this configuration, you will get the infrastructure described and outlined at the beginning of the document. In AWS and within the EKS cluster, the basic resources and services necessary for the operation of the EKS k8s cluster will be created. @@ -432,7 +432,7 @@ terraform/layer1-aws/main.tf terraform/layer2-k8s/main.tf ``` -## Updated terraform providers +## Update terraform providers Change terraform providers version in this files