diff --git a/_sub/compute/eks-heptio/main.tf b/_sub/compute/eks-heptio/main.tf index e800c0288..54b328be6 100644 --- a/_sub/compute/eks-heptio/main.tf +++ b/_sub/compute/eks-heptio/main.tf @@ -30,7 +30,7 @@ resource "local_file" "default-configmap" { } resource "null_resource" "enable-workers-default" { - count = var.blaster_configmap_apply ? 0 : 1 + count = length(var.blaster_configmap_s3_bucket) > 0 ? 0 : 1 provisioner "local-exec" { command = "kubectl --kubeconfig ${var.kubeconfig_path} apply -f ${local.path_default_configmap}" @@ -43,7 +43,7 @@ resource "null_resource" "enable-workers-default" { } resource "null_resource" "enable-workers-from-s3" { - count = var.blaster_configmap_apply ? 1 : 0 + count = length(var.blaster_configmap_s3_bucket) > 0 ? 1 : 0 # Terraform does not seem to re-run script, unless a trigger is defined triggers = { diff --git a/_sub/compute/eks-heptio/vars.tf b/_sub/compute/eks-heptio/vars.tf index 068aed841..b487bbdc3 100644 --- a/_sub/compute/eks-heptio/vars.tf +++ b/_sub/compute/eks-heptio/vars.tf @@ -18,13 +18,10 @@ variable "aws_assume_role_arn" { type = string } -variable "blaster_configmap_apply" { - type = bool - default = false -} variable "blaster_configmap_s3_bucket" { - type = string + description = "The S3 bucket where the blaster configmap is stored. If empty default ConfigMap will be applied. If the bucket or object `var.blaster_configmap_key` specified does not exist, the default ConfigMap will also be used." + type = string } variable "blaster_configmap_key" { diff --git a/compute/eks-ec2/main.tf b/compute/eks-ec2/main.tf index 053672b1a..3edc91540 100644 --- a/compute/eks-ec2/main.tf +++ b/compute/eks-ec2/main.tf @@ -282,7 +282,6 @@ module "eks_heptio" { eks_endpoint = module.eks_cluster.eks_endpoint eks_certificate_authority = module.eks_cluster.eks_certificate_authority eks_role_arn = module.eks_workers.worker_role - blaster_configmap_apply = length(var.blaster_configmap_bucket) >= 1 ? true : false blaster_configmap_s3_bucket = module.blaster_configmap_bucket.bucket_name blaster_configmap_key = "configmap_${module.eks_heptio.cluster_name}_blaster.yml" aws_assume_role_arn = var.aws_assume_role_arn