diff --git a/terraform/java/k8s/deploy/main.tf b/terraform/java/k8s/deploy/main.tf index d77927d52..6af63d4d0 100644 --- a/terraform/java/k8s/deploy/main.tf +++ b/terraform/java/k8s/deploy/main.tf @@ -36,11 +36,15 @@ resource "null_resource" "deploy" { [ ! -e remote-service-depl.yaml ] || rm remote-service-depl.yaml # Clone and install operator onto cluster - echo "LOG: Cloning helm-charts repo" - git clone https://github.com/aws-observability/helm-charts -q - - cd helm-charts/charts/amazon-cloudwatch-observability/ - git reset --hard e0e99c77f69ef388b0ffce769371f7c735a776e4 + echo "LOG: Getting latest helm chart release URL" + latest_version_url=$(curl -s https://api.github.com/repos/aws-observability/helm-charts/releases/latest | grep "tarball_url" | cut -d '"' -f 4) + echo "LOG: The latest helm chart version url is $latest_version_url" + + echo "LOG: Downloading and unpacking the helm chart repo" + curl -L $latest_version_url -o aws-observability-helm-charts-latest.tar.gz + mkdir helm-charts + tar -xvzf aws-observability-helm-charts-latest.tar.gz -C helm-charts + cd helm-charts/aws-observability-helm-charts*/charts/amazon-cloudwatch-observability echo "LOG: Installing CloudWatch Agent Operator using Helm" helm upgrade --install --debug --namespace amazon-cloudwatch amazon-cloudwatch-operator ./ --create-namespace --set region=${var.aws_region} --set clusterName=k8s-cluster-${var.test_id} diff --git a/terraform/python/k8s/deploy/main.tf b/terraform/python/k8s/deploy/main.tf index c1b5f6a7d..852e8b906 100644 --- a/terraform/python/k8s/deploy/main.tf +++ b/terraform/python/k8s/deploy/main.tf @@ -37,10 +37,15 @@ resource "null_resource" "deploy" { [ ! -e python-remote-service-depl.yaml ] || rm python-remote-service-depl.yaml # Clone and install operator onto cluster - echo "LOG: Cloning helm charts repo" - git clone https://github.com/aws-observability/helm-charts.git -q - cd helm-charts/charts/amazon-cloudwatch-observability - git reset --hard e0e99c77f69ef388b0ffce769371f7c735a776e4 + echo "LOG: Getting latest helm chart release URL" + latest_version_url=$(curl -s https://api.github.com/repos/aws-observability/helm-charts/releases/latest | grep "tarball_url" | cut -d '"' -f 4) + echo "LOG: The latest helm chart version url is $latest_version_url" + + echo "LOG: Downloading and unpacking the helm chart repo" + curl -L $latest_version_url -o aws-observability-helm-charts-latest.tar.gz + mkdir helm-charts + tar -xvzf aws-observability-helm-charts-latest.tar.gz -C helm-charts + cd helm-charts/aws-observability-helm-charts*/charts/amazon-cloudwatch-observability echo "LOG: Installing CloudWatch Agent Operator using Helm" helm upgrade --install --debug --namespace amazon-cloudwatch amazon-cloudwatch-operator ./ --create-namespace --set region=${var.aws_region} --set clusterName=k8s-cluster-${var.test_id}