terraform-provider-aws: [Bug]: Error upon plan/apply of `aws_appautoscaling_target` on v4.66.0

Terraform Core Version

0.12.31

AWS Provider Version

4.66.0

Affected Resource(s)

aws_appautoscaling_target

Expected Behavior

Resource provisioning with or without tags.

Actual Behavior

Results in an error snippet when tried with or without tags for aws_appautoscaling_target resource. Please note that the same code was working with v4.65.0 of the Terraform AWS provider and the mentioned Terraform version.

Change introduced in v4.66.0.

Relevant Error/Panic Output Snippet

Error: listing tags for Application Auto Scaling Target (): InvalidParameter: 1 validation error(s) found.
minimum field size of 1, ListTagsForResourceInput.ResourceARN.

Terraform Configuration Files

resource "aws_appautoscaling_target" "ecs_target" {
  max_capacity       = 4
  min_capacity       = 1
  resource_id        = "service/${aws_ecs_cluster.example.name}/${aws_ecs_service.example.name}"
  scalable_dimension = "ecs:service:DesiredCount"
  service_namespace  = "ecs"
}

Steps to Reproduce

terrform plan OR terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 90
  • Comments: 18 (3 by maintainers)

Most upvoted comments

It looks like the problem is that some (all?) targets created before 2023-03-20 (when the tagging feature was added to the AWS SDK) don’t have an ARN assigned. The ARN is used to make the ListTags call which is happening on terraform refresh.

We’ll also have to do something equivalent for the UpdateTags case when default_tags are configured (or even tags on the resource itself).

We’ll fix this and get a patch release published.

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

i’m also seeing this after 4.66 got picked up

The fix is available in v4.66.1 of the Terraform AWS Provider: https://registry.terraform.io/providers/hashicorp/aws/4.66.1.

I have temporarily restricted the version of the provider within my module. (temp fix)

terraform {
  required_version = ">= 1.0.0"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "<= 4.65"
    }
    random = {
      source  = "hashicorp/random"
      version = ">= 2.3.0"
    }
  }
}

Hello , I was facing the same problem, this is specifically related to version 4.66.0 meanwhile, I have fixed it by hardcoding the version to “4.65.0” If you have different version in the locked provider just use

“terraform init upgrade” (To match the version as your config)

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "4.65.0" 
}
}
}

Also had this issue. Looks like is is an issue with the 4.66.0 version of the AWS provider released today. Fixed it by setting the version to 4.65.0 or earlier.