diff --git a/aws-auth-configmap.tf b/aws-auth-configmap.tf index 4f6bed983e99e8b61184296f2a81d4b7cc54b72c..a50b5de5f046b34adfb85018209a1c6a6630e5d5 100644 --- a/aws-auth-configmap.tf +++ b/aws-auth-configmap.tf @@ -25,7 +25,7 @@ resource "kubernetes_config_map" "aws_auth" { labels = merge( { "app.kubernetes.io/managed-by" = "Terraform" - "terraform.io/module" = "terraform-aws-eks-accelerator" + "terraform.io/module" = "terraform-ssp-amazon-eks" }, var.aws_auth_additional_labels ) diff --git a/deploy/advanced/live/preprod/eu-west-1/application_acct/dev/README.md b/deploy/advanced/live/preprod/eu-west-1/application_acct/dev/README.md index 36918f102ce8115980706d77a45289486b80a930..4f8358f3001f2477547f63e048a6c19ec8e3ac88 100644 --- a/deploy/advanced/live/preprod/eu-west-1/application_acct/dev/README.md +++ b/deploy/advanced/live/preprod/eu-west-1/application_acct/dev/README.md @@ -23,14 +23,14 @@ Ensure that you have installed the following tools in your Mac or Windows Laptop #### Step1: Clone the repo using the command below ```shell script -git clone https://gitlab.aws.dev/vabonthu/terraform-aws-eks-accelerator-patterns.git +git clone https://github.com/aws-samples/terraform-ssp-eks-patterns.git ``` #### Step2: Run Terraform INIT to initialize a working directory with configuration files ```shell script -cd deploy/advanced/live/preprod/eu-west-1/application_acct/dev +cd examples/advanced/live/preprod/ terraform init ``` diff --git a/deploy/eks-cluster-with-new-vpc/README.md b/deploy/eks-cluster-with-new-vpc/README.md index 87604b7fd55f1118da571001de908eb0b6fa2fd6..6826af1012b3934dedb361d45275af23355027d2 100644 --- a/deploy/eks-cluster-with-new-vpc/README.md +++ b/deploy/eks-cluster-with-new-vpc/README.md @@ -1,4 +1,4 @@ -# terraform-aws-eks-accelerator-patterns +# terraform-ssp-eks-patterns The following steps walks you through the deployment of this example @@ -23,14 +23,14 @@ Ensure that you have installed the following tools in your Mac or Windows Laptop #### Step1: Clone the repo using the command below ```shell script -git clone https://gitlab.aws.dev/vabonthu/terraform-aws-eks-accelerator-patterns.git +git clone https://github.com/aws-samples/terraform-ssp-eks-patterns.git ``` #### Step2: Run Terraform INIT to initialize a working directory with configuration files ```shell script -cd deploy/eks-cluster-with-new-vpc +cd examples/1-eks-cluster-with-new-vpc/ terraform init ``` diff --git a/kubernetes-addons/fargate-fluentbit/fargate_fluentbit_cw.tf b/kubernetes-addons/fargate-fluentbit/fargate_fluentbit_cw.tf index 4a31b8df15015d3efd8460633ffa4de46f5f9a01..444ab9ca02c7a40e9ba7f234bc62ac271f750462 100755 --- a/kubernetes-addons/fargate-fluentbit/fargate_fluentbit_cw.tf +++ b/kubernetes-addons/fargate-fluentbit/fargate_fluentbit_cw.tf @@ -27,7 +27,7 @@ resource "kubernetes_namespace" "aws_observability" { labels = { aws-observability = "enabled" - "app.kubernetes.io/managed-by" = "terraform-aws-eks-accelerator" + "app.kubernetes.io/managed-by" = "terraform-ssp-amazon-eks" } } } diff --git a/kubernetes-addons/irsa/main.tf b/kubernetes-addons/irsa/main.tf index 1899feaa7ca7ec10513482e14c6fc44186646d07..727ab81c63d718433b253108181f13932181bde2 100644 --- a/kubernetes-addons/irsa/main.tf +++ b/kubernetes-addons/irsa/main.tf @@ -17,21 +17,21 @@ */ # Kubernetes Namesapce -resource "kubernetes_namespace" "ns" { +resource "kubernetes_namespace" "add_on_ns" { metadata { name = var.kubernetes_namespace labels = { - "app.kubernetes.io/managed-by" = "terraform-aws-eks-accelerator" + "app.kubernetes.io/managed-by" = "terraform-ssp-amazon-eks" } } } # Kubernetes service account -resource "kubernetes_service_account" "keda_sa" { +resource "kubernetes_service_account" "add_on_sa" { metadata { name = var.kubernetes_service_account - namespace = kubernetes_namespace.ns.id + namespace = kubernetes_namespace.add_on_ns.id annotations = { "eks.amazonaws.com/role-arn" : aws_iam_role.irsa.arn } } automount_service_account_token = true diff --git a/kubernetes-addons/keda/keda-default-iam-policy.json b/kubernetes-addons/keda/keda-default-iam-policy.json new file mode 100644 index 0000000000000000000000000000000000000000..89943b63f1936312e38f825d43af28dc89ba9807 --- /dev/null +++ b/kubernetes-addons/keda/keda-default-iam-policy.json @@ -0,0 +1,41 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "sqs:GetQueueUrl", + "sqs:ListDeadLetterSourceQueues", + "sqs:ReceiveMessage", + "sqs:GetQueueAttributes", + "sqs:ListQueueTags", + "cloudwatch:DescribeAlarmHistory", + "cloudwatch:GetDashboard", + "cloudwatch:GetInsightRuleReport", + "cloudwatch:ListTagsForResource", + "cloudwatch:DescribeAlarms", + "cloudwatch:GetMetricStream" + ], + "Resource": [ + "arn:aws:cloudwatch:*:${data.aws_caller_identity.current.account_id}:metric-stream/*", + "arn:aws:sqs:*:${data.aws_caller_identity.current.account_id}:*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "cloudwatch:DescribeInsightRules", + "sqs:ListQueues", + "cloudwatch:GetMetricData", + "cloudwatch:ListMetricStreams", + "cloudwatch:DescribeAlarmsForMetric", + "cloudwatch:ListDashboards", + "cloudwatch:GetMetricStatistics", + "cloudwatch:GetMetricWidgetImage", + "cloudwatch:ListMetrics", + "cloudwatch:DescribeAnomalyDetectors" + ], + "Resource": "*" + } + ] +} diff --git a/kubernetes-addons/keda/main.tf b/kubernetes-addons/keda/main.tf index c30a4396dd94360c87c85561eb0208bf63283345..b26e93cefa8216c2784d72d6021d23062bcdff92 100644 --- a/kubernetes-addons/keda/main.tf +++ b/kubernetes-addons/keda/main.tf @@ -93,52 +93,9 @@ module "irsa" { resource "aws_iam_policy" "keda_irsa" { count = var.keda_create_irsa ? 1 : 0 + description = "KEDA IAM role policy for SQS and CloudWatch" name = "${var.eks_cluster_name}-${local.keda_helm_app["name"]}-irsa" path = var.iam_role_path - description = "KEDA IAM role policy for SQS and CloudWatch" - - policy = <<EOF -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "sqs:GetQueueUrl", - "sqs:ListDeadLetterSourceQueues", - "sqs:ReceiveMessage", - "sqs:GetQueueAttributes", - "sqs:ListQueueTags", - "cloudwatch:DescribeAlarmHistory", - "cloudwatch:GetDashboard", - "cloudwatch:GetInsightRuleReport", - "cloudwatch:ListTagsForResource", - "cloudwatch:DescribeAlarms", - "cloudwatch:GetMetricStream" - ], - "Resource": [ - "arn:aws:cloudwatch:*:${data.aws_caller_identity.current.account_id}:metric-stream/*", - "arn:aws:sqs:*:${data.aws_caller_identity.current.account_id}:*" - ] - }, - { - "Effect": "Allow", - "Action": [ - "cloudwatch:DescribeInsightRules", - "sqs:ListQueues", - "cloudwatch:GetMetricData", - "cloudwatch:ListMetricStreams", - "cloudwatch:DescribeAlarmsForMetric", - "cloudwatch:ListDashboards", - "cloudwatch:GetMetricStatistics", - "cloudwatch:GetMetricWidgetImage", - "cloudwatch:ListMetrics", - "cloudwatch:DescribeAnomalyDetectors" - ], - "Resource": "*" - } - ] -} -EOF + policy = file("${path.module}/keda-default-iam-policy.json") }