Skip to content

Commit

Permalink
Remove helm (will add for testing).
Browse files Browse the repository at this point in the history
  • Loading branch information
musa-asad committed Nov 15, 2024
1 parent 83ae443 commit 6ea0508
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions terraform/e2e/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,63 +92,7 @@ resource "aws_iam_role_policy_attachment" "node_CloudWatchAgentServerPolicy" {
role = aws_iam_role.node_role.name
}

resource "null_resource" "kubectl" {
depends_on = [
aws_eks_cluster.this,
aws_eks_node_group.this
]
provisioner "local-exec" {
command = <<-EOT
${local.aws_eks} update-kubeconfig --name ${aws_eks_cluster.this.name}
${local.aws_eks} list-clusters --output text
${local.aws_eks} describe-cluster --name ${aws_eks_cluster.this.name} --output text
EOT
}
}

resource "null_resource" "install_helm_release_and_sample_app" {
depends_on = [
null_resource.kubectl,
aws_eks_cluster.this,
aws_eks_node_group.this
]

provisioner "local-exec" {
command = <<-EOT
${local.aws_eks} update-kubeconfig --name ${aws_eks_cluster.this.name}
helm upgrade --install amazon-cloudwatch-observability \
${path.module}/helm-charts/charts/amazon-cloudwatch-observability \
--values ${path.module}/helm-charts/charts/amazon-cloudwatch-observability/values.yaml \
--set clusterName=${aws_eks_cluster.this.name} \
--set region=${var.region} \
--set agent.image.repository=${var.cloudwatch_agent_repository} \
--set agent.image.tag=${var.cloudwatch_agent_tag} \
--set agent.image.repositoryDomainMap.public=${var.cloudwatch_agent_repository_url} \
--set manager.image.repository=${var.cloudwatch_agent_operator_repository} \
--set manager.image.tag=${var.cloudwatch_agent_operator_tag} \
--set manager.image.repositoryDomainMap.public=${var.cloudwatch_agent_operator_repository_url} \
--namespace amazon-cloudwatch \
--create-namespace \
${var.agent-config != "" ? "--set-json agent.config='${jsonencode(jsondecode(file(var.agent-config)))}'" : ""} \
${var.otel-config != "" ? "--set-file agent.otelConfig=${yamlencode(yamldecode(file(var.otel-config)))}" : ""} \
${var.prometheus-config != "" ? "--set-file agent.prometheus.config=${yamlencode(yamldecode(file(var.prometheus-config)))}" : ""}
kubectl apply -f ${var.sample-app}
kubectl wait --for=condition=available --timeout=300s deployment/${var.sample-app-name}
EOT

environment = {
KUBECONFIG = "$HOME/.kube/config"
}
}
}

resource "null_resource" "test" {
depends_on = [
null_resource.install_helm_release_and_sample_app
]

provisioner "local-exec" {
command = "go test -v ${var.validate_test}"
}
Expand Down

0 comments on commit 6ea0508

Please sign in to comment.