From 622ad3a54a880a1058ca85a517efe19de1f31849 Mon Sep 17 00:00:00 2001 From: Viktor Bushmin Date: Sun, 20 Sep 2020 16:44:09 +0300 Subject: [PATCH 1/3] Added AWS Credentials to main.tf cause of error on my AWS with No such credentials was found On branch master Changes: modified: AUTHORS.md - added myself :) modified: main.tf - added aws credentials to kubernetes_deployment.spec.container.env modified: variables.tf - added vars aws access key and secret modified: versions.tf - terraform 0.13update --- AUTHORS.md | 1 + main.tf | 13 +++++++++++++ variables.tf | 12 +++++++++++- versions.tf | 10 +++++++++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 0338d49..b496b80 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -8,3 +8,4 @@ - Daniel Randall <dgrandall@me.com> - Samer Shami <gitkraken@shogun.work> +- Viktor Bushmin <viktor.bushmin@gmail.com> diff --git a/main.tf b/main.tf index 0421996..13ebf8e 100644 --- a/main.tf +++ b/main.tf @@ -407,6 +407,19 @@ resource "kubernetes_deployment" "this" { "--aws-max-retries=10", ] + env { + name = "AWS_REGION" + value = local.aws_region_name + } + env { + name = "AWS_ACCESS_KEY_ID" + value = var.aws_access_key + } + env { + name = "AWS_SECRET_ACCESS_KEY" + value = var.aws_secret_access_key + } + port { name = "health" container_port = 10254 diff --git a/variables.tf b/variables.tf index de9fe6e..7abf99d 100644 --- a/variables.tf +++ b/variables.tf @@ -67,5 +67,15 @@ variable "aws_tags" { variable "aws_alb_ingress_controller_version" { description = "The AWS ALB Ingress Controller version to use. See https://github.com/kubernetes-sigs/aws-alb-ingress-controller/releases for available versions" type = string - default = "1.1.7" + default = "1.1.9" } + +variable "aws_access_key" { + description = "The AWS Access Key with no default" + type = string +} + +variable "aws_secret_access_key" { + description = "The AWS Secret Access Key with no default" + type = string +} \ No newline at end of file diff --git a/versions.tf b/versions.tf index d9b6f79..b73ebcc 100644 --- a/versions.tf +++ b/versions.tf @@ -1,3 +1,11 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" + required_providers { + aws = { + source = "hashicorp/aws" + } + kubernetes = { + source = "hashicorp/kubernetes" + } + } } From e29e95fa85eb93179c2b7688e6d24f6cded3072e Mon Sep 17 00:00:00 2001 From: Viktor Bushmin Date: Sun, 20 Sep 2020 16:47:57 +0300 Subject: [PATCH 2/3] terraform fmt On branch master modified: main.tf --- main.tf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/main.tf b/main.tf index 13ebf8e..a2a0e3f 100644 --- a/main.tf +++ b/main.tf @@ -407,18 +407,18 @@ resource "kubernetes_deployment" "this" { "--aws-max-retries=10", ] - env { - name = "AWS_REGION" - value = local.aws_region_name - } - env { - name = "AWS_ACCESS_KEY_ID" - value = var.aws_access_key - } - env { - name = "AWS_SECRET_ACCESS_KEY" - value = var.aws_secret_access_key - } + env { + name = "AWS_REGION" + value = local.aws_region_name + } + env { + name = "AWS_ACCESS_KEY_ID" + value = var.aws_access_key + } + env { + name = "AWS_SECRET_ACCESS_KEY" + value = var.aws_secret_access_key + } port { name = "health" From 89f0decb23d021ab02bf24b3ff9967aec5059632 Mon Sep 17 00:00:00 2001 From: Viktor Bushmin Date: Mon, 21 Sep 2020 19:50:34 +0300 Subject: [PATCH 3/3] Added pods/status to resources of the role due to https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v1.1.8/docs/examples/rbac-role.yaml On branch master modified: main.tf --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index a2a0e3f..3e1c400 100644 --- a/main.tf +++ b/main.tf @@ -258,6 +258,7 @@ resource "kubernetes_cluster_role" "this" { "ingresses", "ingresses/status", "services", + "pods/status", ] verbs = [