title: Terraform aws_eks_node_group creation error with launch_template "Unsupported - The requested configuration is currently not supported"
body: <p><strong>Objective of my effort</strong>: Create EKS node with Custom AMI(ubuntu)</p>
  <p><strong>Issue Statement</strong>: On creating aws_eks_node_group along with launch_template, I am getting an error:</p>
  <blockquote>
  <p>Error: error waiting for EKS Node Group (qa-svr-centinela-eks-cluster01:qa-svr-centinela-nodegroup01) creation: AsgInstanceLaunchFailures: Could not launch On-Demand Instances. Unsupported - The requested configuration is currently not supported. Please check the documentation for supported configurations. Launching EC2 instance failed.. Resource IDs: [eks-82bb24f0-2d7e-ba9d-a80a-bb9653cde0c6]</p>
  </blockquote>
  <p><strong>Research so far</strong>: As per <a href="https://aws.amazon.com/blogs/containers/introducing-launch-template-and-custom-ami-support-in-amazon-eks-managed-node-groups/" rel="nofollow noreferrer">AWS</a> we can start using custom AMIs for EKS.
  Now the custom ubuntu image that I am using, is built with Packer, and I was encrypting the boot, and using AWS KMS External key for that purpose. At first I thought maybe the encryption used for the AMI is causing problem. So I removed the encryption for the AMI from the packer code.
  But it didn't resolve the issue. Maybe I am not thinking in the right direction?</p>
  <p>Any help is much appreciated. Thanks.</p>
  <p>Terraform code used is in the post below.</p>
  <p>I am attempting to create an EKS node group with launch template. But getting into an error.</p>
  <p><strong>packer code</strong></p>
  <pre><code>source &quot;amazon-ebs&quot; &quot;ubuntu18&quot; {
      ami_name = &quot;pxx3&quot;
      ami_virtualization_type = &quot;hvm&quot;
      tags = {
          &quot;cc&quot; = &quot;sxx1&quot;
          &quot;Name&quot; = &quot;packerxx3&quot;
      }
      region = &quot;us-west-2&quot;
      instance_type = &quot;t3.small&quot;
      # AWS Ubuntu AMI 
      source_ami = &quot;ami-0ac73f33a1888c64a&quot;
      associate_public_ip_address = true
      ebs_optimized = true
      # public subnet
      subnet_id = &quot;subnet-xx&quot;
      vpc_id = &quot;vpc-xx&quot;
      communicator = &quot;ssh&quot;
      ssh_username = &quot;ubuntu&quot;
  }
  build {
      sources = [
          &quot;source.amazon-ebs.ubuntu18&quot;
      ]
      provisioner &quot;ansible&quot; {
          playbook_file = &quot;./ubuntu.yml&quot;
      }
  }
  </code></pre>
  <p><strong>ubuntu.yml</strong> - only used for installing a few libraries</p>
  <pre><code>---
  - hosts: default
    gather_facts: no
    become: yes
    tasks:
      - name: create the license key for new relic agent
        shell: |
          curl -s https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | apt-key add - &amp;&amp; \
          printf &quot;deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt bionic main&quot; | tee -a /etc/apt/sources.list.d/newrelic-infra.list
      - name: check sources.list
        shell: |
          cat /etc/apt/sources.list.d/newrelic-infra.list
      - name: apt-get update
        apt: update_cache=yes force_apt_get=yes
      - name: install new relic agent
        package:
          name: newrelic-infra
          state: present
      - name: update apt-get repo and cache
        apt: update_cache=yes force_apt_get=yes
      - name: apt-get upgrade
        apt: upgrade=dist force_apt_get=yes
      - name: install essential softwares
        package:
          name: &quot;{{ item }}&quot;
          state: latest
        loop:
          - software-properties-common
          - vim
          - nano
          - glibc-source
          - groff
          - less
          - traceroute
          - whois
          - telnet
          - dnsutils
          - git
          - mlocate
          - htop
          - zip
          - unzip
          - curl
          - ruby-full
          - wget
        ignore_errors: yes
      - name: Add the ansible PPA to your system’s sources list
        apt_repository:
          repo: ppa:ansible/ansible
          state: present
          mode: 0666
      - name: Add the deadsnakes PPA to your system’s sources list
        apt_repository:
          repo: ppa:deadsnakes/ppa
          state: present
          mode: 0666
      - name: install softwares
        package:
          name: &quot;{{ item }}&quot;
          state: present
        loop:
          - ansible
          - python3.8
          - python3-winrm
        ignore_errors: yes
      - name: install AWS CLI
        shell: |
          curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;
          unzip awscliv2.zip
          ./aws/install
  </code></pre>
  <p><strong>aws_eks_node_group configuration.</strong></p>
  <pre><code>resource &quot;aws_eks_node_group&quot; &quot;nodegrp&quot; {
    cluster_name    = aws_eks_cluster.eks.name
    node_group_name = &quot;xyz-nodegroup01&quot;
    node_role_arn   = aws_iam_role.eksnode.arn
    subnet_ids      = [data.aws_subnet.tf_subnet_private01.id, data.aws_subnet.tf_subnet_private02.id]
    scaling_config {
      desired_size = 2
      max_size     = 2
      min_size     = 2
    }
    depends_on = [
      aws_iam_role_policy_attachment.nodepolicy01,
      aws_iam_role_policy_attachment.nodepolicy02,
      aws_iam_role_policy_attachment.nodepolicy03
    ]
    launch_template {
      id = aws_launch_template.eks.id
      version = aws_launch_template.eks.latest_version
    }
  }
  </code></pre>
  <p><strong>aws_launch_template configuration.</strong></p>
  <pre><code>resource &quot;aws_launch_template&quot; &quot;eks&quot; {
    name = &quot;${var.env}-launch-template&quot;
    update_default_version = true
    block_device_mappings {
      device_name = &quot;/dev/sda1&quot;
      ebs {
        volume_size = 50
      }
    }
    credit_specification {
      cpu_credits = &quot;standard&quot;
    }
    ebs_optimized                        = true
    # AMI generated with packer (is private)
    image_id                             = &quot;ami-0ac71233a184566453&quot;
    instance_type                        = t3.micro
    key_name                             = &quot;xyz&quot;
    network_interfaces {
      associate_public_ip_address = false
    }
  }
  </code></pre>