Skip to content

Error: Unsupported block type in v20.14.0Β #3388

@DavydDerkach

Description

@DavydDerkach

Description

Our team is using your module to deploy eks and related resources with terragrunt. We use module version v20.14.0.
Starting from today (24.06.2025) we receive errors event if there no changes have been made:

β”‚ Error: Unsupported block type
β”‚
β”‚   on modules/self-managed-node-group/main.tf line 192, in resource "aws_launch_template" "this":
β”‚  192:   dynamic "elastic_gpu_specifications" {
β”‚
β”‚ Blocks of type "elastic_gpu_specifications" are not expected here.

If your request is for a new feature, please use the Feature request template.

  • [ yes] βœ‹ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 20.14.0

  • TERRAGRUNT version: v0.63.0

  • Provider version(s):
    Terraform v1.9.4
    on linux_amd64
  • provider registry.terraform.io/hashicorp/aws v6.0.0
  • provider registry.terraform.io/hashicorp/cloudinit v2.3.7
  • provider registry.terraform.io/hashicorp/kubernetes v2.37.1
  • provider registry.terraform.io/hashicorp/null v3.2.4
  • provider registry.terraform.io/hashicorp/time v0.13.1
  • provider registry.terraform.io/hashicorp/tls v4.1.0

Reproduction Code [Required]

include "root" {
  path           = find_in_parent_folders()
  expose         = true
  merge_strategy = "deep"
}

locals {
  cluster = merge (yamldecode(file(find_in_parent_folders("cluster_values.yaml"))))
  full_name = "${include.root.locals.full_name}-${local.cluster.cluster_id}"
}

generate "provider-local" {
  path      = "provider-local.tf"
  if_exists = "overwrite_terragrunt"
  contents  = <<EOF

    data "aws_eks_cluster" "eks" {
        name = aws_eks_cluster.this[0].id
    }

    data "aws_eks_cluster_auth" "eks" {
        name = aws_eks_cluster.this[0].id
    }

    provider "kubernetes" {
        host                   = data.aws_eks_cluster.eks.endpoint
        cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks.certificate_authority[0].data)
        token                  = data.aws_eks_cluster_auth.eks.token
        config_path = "~/.kube/config"
    }
EOF
}

terraform {
  source = "github.com/terraform-aws-modules/terraform-aws-eks?ref=v20.14.0"
  after_hook "kubeconfig" {
    commands = ["apply"]
    execute  = ["bash", "-c", "aws eks update-kubeconfig --region ${include.root.locals.merged.aws_region} --name ${local.full_name} --kubeconfig ~/.kube/${local.full_name}.config 2>/dev/null"]
  }

  after_hook "kube-system-label" {
    commands = ["apply"]
    execute  = ["bash", "-c", "kubectl --kubeconfig ~/.kube/${local.full_name}.config label ns kube-system name=kube-system --overwrite"]
  }

  after_hook "undefault-gp2" {
    commands = ["apply"]
    execute  = ["bash", "-c", "kubectl --kubeconfig ~/.kube/${local.full_name}.config patch storageclass gp2 -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"false\"}}}'"]
  }

  after_hook "update-coredns-affinity" {
    commands = ["apply"]
    execute = ["bash", "-c", "kubectl --kubeconfig ~/.kube/config patch deployment coredns -n kube-system -p '{\"spec\": {\"template\": {\"spec\": {\"nodeSelector\": {\"infra-node\": \"true\"}, \"tolerations\": [{\"key\": \"infra-node\", \"operator\": \"Exists\", \"effect\": \"NoSchedule\"}, {\"key\": \"infra-node\", \"operator\": \"Exists\", \"effect\": \"NoExecute\"}]}}}}'"]
  }
}

dependency "vpc" {

  config_path                             = "../../vpc/"
  mock_outputs_allowed_terraform_commands = ["init", "validate", "plan", "destroy"]
  mock_outputs_merge_strategy_with_state  = "deep_map_only"
  mock_outputs = {
    vpc_id          = "dummy-id"
    private_subnets = ["dummy-private-subnets"]
  }
}

dependency "encryption_config" {
  config_path                             = "../encryption-config/"
  mock_outputs_allowed_terraform_commands = ["init", "validate", "plan", "destroy"]
  mock_outputs_merge_strategy_with_state  = "deep_map_only"
  mock_outputs = {
    arn = "dummy-arn"
  }
}

inputs = {
  cluster_name                         = "${local.full_name}"
  cluster_version                      = "${local.cluster.cluster_version}"
  cluster_enabled_log_types = []#["audit", "api", "authenticator", "controllerManager", "scheduler"]
  vpc_id                               = dependency.vpc.outputs.vpc_id
  subnet_ids                           = dependency.vpc.outputs.private_subnets
  enable_irsa                          = true
  cluster_endpoint_private_access      = true
  cluster_endpoint_public_access       = true
  cluster_endpoint_public_access_cidrs = "${local.cluster.allowed_ips}"
  cluster_encryption_config = {
    provider_key_arn = dependency.encryption_config.outputs.arn
    resources = ["secrets"]
  }

.....

Steps to reproduce the behavior:

just run terragrunt apply using module version v20.14.0

Expected behavior

Output without errors when I don`t make any changes.

Actual behavior

β”‚ Error: Unsupported block type
β”‚
β”‚   on modules/eks-managed-node-group/main.tf line 137, in resource "aws_launch_template" "this":
β”‚  137:   dynamic "elastic_gpu_specifications" {
β”‚
β”‚ Blocks of type "elastic_gpu_specifications" are not expected here.
β•΅
β•·
β”‚ Error: Unsupported block type
β”‚
β”‚   on modules/eks-managed-node-group/main.tf line 145, in resource "aws_launch_template" "this":
β”‚  145:   dynamic "elastic_inference_accelerator" {
β”‚
β”‚ Blocks of type "elastic_inference_accelerator" are not expected here.
β•΅
β•·
β”‚ Error: Unsupported block type
β”‚
β”‚   on modules/self-managed-node-group/main.tf line 192, in resource "aws_launch_template" "this":
β”‚  192:   dynamic "elastic_gpu_specifications" {
β”‚
β”‚ Blocks of type "elastic_gpu_specifications" are not expected here.
β•΅
β•·
β”‚ Error: Unsupported block type
β”‚
β”‚   on modules/self-managed-node-group/main.tf line 200, in resource "aws_launch_template" "this":
β”‚  200:   dynamic "elastic_inference_accelerator" {
β”‚
β”‚ Blocks of type "elastic_inference_accelerator" are not expected here.

Terminal Output Screenshot(s)

In section above

Additional context

Couple days ago everything was fine. We have not made any changes to tf code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions