From 8dabfe75e684819c34676ad4fe7c9ab48f8ecf5a Mon Sep 17 00:00:00 2001 From: Yunjian Lu <43796475+yunjianlu@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:44:21 -0800 Subject: [PATCH] update: Install ACK with helm chart (#1180) Co-authored-by: Yunjian --- .../controlplanes/ack/.workshop/cleanup.sh | 4 +- .../ack/.workshop/terraform/main.tf | 59 +++++++++++-------- .../ack/.workshop/terraform/outputs.tf | 4 +- .../controlplanes/ack/how-it-works.md | 8 --- .../automation/controlplanes/ack/index.md | 3 +- .../controlplanes/ack/introduction.md | 33 +++++++++++ 6 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 website/docs/automation/controlplanes/ack/introduction.md diff --git a/manifests/modules/automation/controlplanes/ack/.workshop/cleanup.sh b/manifests/modules/automation/controlplanes/ack/.workshop/cleanup.sh index 3fbeea43e..80a5d5576 100755 --- a/manifests/modules/automation/controlplanes/ack/.workshop/cleanup.sh +++ b/manifests/modules/automation/controlplanes/ack/.workshop/cleanup.sh @@ -2,4 +2,6 @@ logmessage "Deleting resources created by ACK..." -delete-all-if-crd-exists tables.dynamodb.services.k8s.aws \ No newline at end of file +delete-all-if-crd-exists tables.dynamodb.services.k8s.aws + +uninstall-helm-chart ack-dynamodb ack-dynamodb-chart \ No newline at end of file diff --git a/manifests/modules/automation/controlplanes/ack/.workshop/terraform/main.tf b/manifests/modules/automation/controlplanes/ack/.workshop/terraform/main.tf index 5330c0ba2..6426f29fe 100644 --- a/manifests/modules/automation/controlplanes/ack/.workshop/terraform/main.tf +++ b/manifests/modules/automation/controlplanes/ack/.workshop/terraform/main.tf @@ -19,29 +19,6 @@ data "aws_ecrpublic_authorization_token" "token" { provider = aws.virginia } -#This module installs the ACK controller for DynamoDB through the AWS EKS Addons for ACK -module "dynamodb_ack_addon" { - - source = "aws-ia/eks-ack-addons/aws" - version = "2.2.0" - - # Cluster Info - cluster_name = var.addon_context.eks_cluster_id - cluster_endpoint = var.addon_context.aws_eks_cluster_endpoint - oidc_provider_arn = var.addon_context.eks_oidc_provider_arn - - ecrpublic_username = data.aws_ecrpublic_authorization_token.token.user_name - ecrpublic_token = data.aws_ecrpublic_authorization_token.token.password - - # Controllers to enable - enable_dynamodb = true - dynamodb = { - role_name = "${var.addon_context.eks_cluster_id}-ack-ddb" - role_name_use_prefix = false - } - - tags = var.tags -} module "iam_assumable_role_carts" { source = "terraform-aws-modules/iam/aws//modules/iam-assumable-role-with-oidc" @@ -79,6 +56,42 @@ EOF tags = var.tags } +resource "aws_iam_policy" "ack_dynamo" { + name = "${var.addon_context.eks_cluster_id}-ack-dynamo" + path = "/" + description = "Dynamo policy for carts application" + + policy = <