terraform-aws-modules / terraform-aws-acm

Terraform module to create AWS ACM resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/acm/aws
Apache License 2.0
182 stars 229 forks source link

An argument named "key_algorithm" is not expected here #127

Closed atyndall closed 1 year ago

atyndall commented 1 year ago

Description

If you are using the ACM module with a version string like version = "~> 4.0" (which is in the docs example) and your terraform-aws provider version is currently < 4.40.0, there is a breaking error, due to the fact that the key_algorithm parameter introduced in v4.3.0 is not supported on provider versions less than that.

I'm not sure if this change should have been done with a minor version, as depending on your pinning, it can cause weird interactions and errors.

Versions

Reproduction Code [Required]

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "4.24.0"
    }
  }
  required_version = ">= 1.2.0"
}

provider "aws" {
  region = "us-west-2"
}

module "acm" {
  source  = "terraform-aws-modules/acm/aws"
  version = "~> 4.0"
  domain_name = "test.com"
}

Steps to reproduce the behavior:

terraform apply

Expected behavior

Major version should potentially be incremented for a backwards incompatible change?

Actual behavior

Terraform error: An argument named "key_algorithm" is not expected here.

Terminal Output Screenshot(s)

β•·
β”‚ Error: Unsupported argument
β”‚ 
β”‚   on .terraform/modules/foo.acm/main.tf line 25, in resource "aws_acm_certificate" "this":
β”‚   25:   key_algorithm             = var.key_algorithm
β”‚ 
β”‚ An argument named "key_algorithm" is not expected here.
β•΅
ilaif commented 1 year ago

We've run into this as well πŸ™πŸΌ

antonbabenko commented 1 year ago

This issue has been resolved in version 4.3.1 :tada:

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.