<p>I'm using the AWS EKS provider (github.com/terraform-aws-modules/terraform-aws-eks ). I'm following along the tutorial with <a href="https://learn.hashicorp.com/terraform/aws/eks-intro" rel="noreferrer">https://learn.hashicorp.com/terraform/aws/eks-intro</a></p>

<p>However this does not seem to have autoscaling enabled... It seems it's missing the <code>cluster-autoscaler</code> pod / daemon? </p>

<p>Is Terraform able to provision this functionality? Or do I need to set this up following a guide like: <a href="https://eksworkshop.com/scaling/deploy_ca/" rel="noreferrer">https://eksworkshop.com/scaling/deploy_ca/</a></p>

Chris Stryczynski
<p>You can deploy Kubernetes resources using Terraform. There is both a Kubernetes provider and a Helm provider. </p>

<pre><code>data "aws_eks_cluster_auth" "authentication" {
  name = "${var.cluster_id}"
}

provider "kubernetes" {
  # Use the token generated by AWS iam authenticator to connect as the provider does not support exec auth
  # see: https://github.com/terraform-providers/terraform-provider-kubernetes/issues/161
  host = "${var.cluster_endpoint}"

  cluster_ca_certificate = "${base64decode(var.cluster_certificate_authority_data)}"
  token                  = "${data.aws_eks_cluster_auth.authentication.token}"
  load_config_file       = false
}

provider "helm" {
  install_tiller  = "true"
  tiller_image    = "gcr.io/kubernetes-helm/tiller:v2.12.3"
}

resource "helm_release" "cluster_autoscaler" {
  name       = "cluster-autoscaler"
  repository = "stable"
  chart      = "cluster-autoscaler"
  namespace  = "kube-system"
  version    = "0.12.2"

  set {
    name  = "autoDiscovery.enabled"
    value = "true"
  }

  set {
    name  = "autoDiscovery.clusterName"
    value = "${var.cluster_name}"
  }

  set {
    name  = "cloudProvider"
    value = "aws"
  }

  set {
    name  = "awsRegion"
    value = "${data.aws_region.current_region.name}"
  }

  set {
    name  = "rbac.create"
    value = "true"
  }

  set {
    name  = "sslCertPath"
    value = "/etc/ssl/certs/ca-bundle.crt"
  }
}

</code></pre>
