hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.64k stars 9.02k forks source link

EKS Addon version not accepting valid values #26275

Open lamebear opened 1 year ago

lamebear commented 1 year ago

Community Note

Terraform CLI and Terraform AWS Provider Version

Terraform v1.2.7 on darwin_arm64

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.19"
    }
  }

  required_version = ">= 1.0.0"
}

provider "aws" {
  region = "us-west-2"
  assume_role {
    session_name = "TerraformDeploy"
    role_arn     = "<omitted>"
    external_id  = "<omitted>"
  }
}

data "aws_eks_cluster" "example" {
  name = "moshpit-eks"
}

resource "aws_eks_addon" "kube_proxy" {
  cluster_name      = data.aws_eks_cluster.example.name
  addon_name        = "kube-proxy"
  addon_version     = "1.22.11-eksbuild.2"
  resolve_conflicts = "OVERWRITE"
}

Debug Output

https://gist.github.com/lamebear/76d655e9727c6531ed3cc85ad44654bb

Expected Behavior

The EKS Addon should be created with version 1.22.11-eksbuild.2. This is a valid version: https://docs.aws.amazon.com/eks/latest/userguide/managing-kube-proxy.html

Actual Behavior

Terraform errors with the addon version not following semantic versioning.

Error: invalid value for addon_version (must follow semantic version format)

   with aws_eks_addon.kube_proxy,
   on main.tf line 28, in resource "aws_eks_addon" "kube_proxy":
   28:   addon_version     = "1.22.11-eksbuild.2"

Steps to Reproduce

  1. terraform apply
breathingdust commented 1 year ago

Hi @lamebear! 👋 It looks like the AWS API (and our own client side validation) is looking for the addon version with a v prefix. Can you try addon_version = "v1.22.11-eksbuild.2" and let me know if that works for you?