Configurable local exec command for waiting until cluster is healthy (#701)

* Configurable local exec command for waiting until cluster is healthy

* readme

* line feeds

* format

* fix readme

* fix readme

* Configurable local exec command for waiting until cluster is healthy (#1)

* Configurable local exec command for waiting until cluster is healthy

* readme

* line feeds

* format

* fix readme

* fix readme

* change log

* Configurable local exec wait 4 cluster op (#2)

* Configurable local exec command for waiting until cluster is healthy

* readme

* line feeds

* format

* fix readme

* fix readme

* change log

* changelog (#3)

* Changelog (#4)

* changelog

* changelog

* simplify wait_for_cluster command

* readme

* no op for manage auth false

* formatting

* docs? not sure

* linter

* specify dependency to wait for cluster more accurately
This commit is contained in:
Sanjeev Giri
2020-01-27 10:29:24 -05:00
committed by Max Williams
parent 317b9481ad
commit 905d9f05a9
5 changed files with 20 additions and 10 deletions

View File

@@ -32,10 +32,20 @@ resource "aws_eks_cluster" "this" {
aws_iam_role_policy_attachment.cluster_AmazonEKSServicePolicy,
aws_cloudwatch_log_group.this
]
}
resource "null_resource" "wait_for_cluster" {
count = var.manage_aws_auth ? 1 : 0
depends_on = [
aws_eks_cluster.this[0]
]
provisioner "local-exec" {
command = <<EOT
until curl -k -s ${aws_eks_cluster.this[0].endpoint}/healthz >/dev/null; do sleep 4; done
EOT
command = var.wait_for_cluster_cmd
environment = {
ENDPOINT = aws_eks_cluster.this[0].endpoint
}
}
}