feat: Replace the local-exec script with a http datasource for waiting cluster (#1339)

NOTES: Using the [terraform-aws-modules/http](https://registry.terraform.io/providers/terraform-aws-modules/http/latest) provider is a more platform agnostic way to wait for the cluster availability than using a local-exec. With this change we're able to provision EKS clusters and manage the `aws_auth` configmap while still using the `hashicorp/tfc-agent` docker image.
This commit is contained in:
Thierno IB. BARRY
2021-05-17 10:11:36 +02:00
committed by GitHub
parent 781f673295
commit e3bf48bba2
7 changed files with 35 additions and 64 deletions

View File

@@ -64,7 +64,7 @@ locals {
resource "kubernetes_config_map" "aws_auth" {
count = var.create_eks && var.manage_aws_auth ? 1 : 0
depends_on = [null_resource.wait_for_cluster[0]]
depends_on = [data.http.wait_for_cluster[0]]
metadata {
name = "aws-auth"
@@ -72,7 +72,7 @@ resource "kubernetes_config_map" "aws_auth" {
labels = merge(
{
"app.kubernetes.io/managed-by" = "Terraform"
# / are replaced by . because label validator fails in this lib
# / are replaced by . because label validator fails in this lib
# https://github.com/kubernetes/apimachinery/blob/1bdd76d09076d4dc0362456e59c8f551f5f24a72/pkg/util/validation/validation.go#L166
"terraform.io/module" = "terraform-aws-modules.eks.aws"
},