terraform-provider-aws: 3.14.0 Regression: Error: InvalidParameter: 1 validation error(s) found. - minimum field size of 1, ListTargetsByRuleInput.EventBusName.

Looks like 3.14.0 has a regression.

My code deployment process which runs every couple hours just started failing today. I also noticed that an hour ago 3.14 of this package was released. I’m getting a bunch of these errors when I run a plan operation. This is blocking my deployments. I’ll try and specify the old version of this package in my code but you should try and resolve this quickly.

Error: InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, ListTargetsByRuleInput.EventBusName.

image

image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 111
  • Comments: 31 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Update: Specifying 3.13.0 let my Terraform Plan command and deployment work.

provider "aws" {
  version = "3.13.0"
  region  = var.region
}

Skipping 3.14.0 fixes my failing pipelines - and should allow for next version up

provider "aws" {
  version = "~> 3.0,!= 3.14.0"
  region  = var.aws_region

I also experience this issue with version 3.14.0

The fix for this has been merged and will release with version 3.14.1 of the Terraform AWS Provider, in the next 20-30 minutes. 👍

Marking as 3.15.0, but we may release as 3.14.1.

Skipping 3.14.0 fixes my failing pipelines - and should allow for next version up

provider "aws" {
  version = "~> 3.0,!= 3.14.0"
  region  = var.aws_region

This worked for me too.

Same issue

Confirm new version (3.14.1) fixed it for us. Thanks for jumping on this quickly team!

This has been released in version 3.14.1 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

I have the same error

Error: InvalidParameter: 1 validation error(s) found.

| - minimum field size of 1, ListTargetsByRuleInput.EventBusName.   |

I have pinned the previous version for now

provider "aws" {
  version = "~> 3.13.0"
  region  = var.aws_region

and it works

Same. From what I can tell it appears to be the ‘aws_cloudwatch_event_target’ which is supposed to have a default value for ‘event_bus_name’ but instead throws an error. #15799

Seems related to some names length. Provider 3.14 works perfectly fine for my resources with shorter names, fails for the same code but a few letters more in the name. (fine) glue-crawler-event-compressed-sns-topic-dev (fine) glue-crawler-event-compressed-sns-topic-test (fail) glue-crawler-event-compressed-sns-topic-research (fail) glue-crawler-event-compressed-sns-topic-staging edit: it seems that 3.14 is failing for other envs too

The resources that I am creating in the module are aws_cloudwatch_event_rule, aws_cloudwatch_event_target, and aws_sns_topic

If we are going to do the pinning we would need to change this and re-run potentially 300 workspaces.

It seems the problem is linked to state migration from 3.13.x to 3.14.0

Simple example to reproduce:

terraform {
  required_version = ">= 0.12"
}

provider "aws" {
  region  = "eu-central-1"
  version = "3.13.0"
}

resource "aws_cloudwatch_event_rule" "cloudwatch_event_is_alive" {
  name                = "cer-is_alive"
  description         = "Trigger lambda is alive every 1 minutes"
  schedule_expression = "rate(1 minute)"
  is_enabled          = true
}

resource "aws_cloudwatch_event_target" "cloudwatch_event_target_is_alive" {
  rule      = aws_cloudwatch_event_rule.cloudwatch_event_is_alive.name
  target_id = "lambda_is_alive"
  arn       = aws_lambda_function.test_lambda.arn
}

resource "aws_lambda_permission" "allow_cloudwatch_event_to_call_lamdba_is_alive" {
  statement_id  = "AllowExecutionFromCloudWatch"
  action        = "lambda:InvokeFunction"
  function_name = aws_lambda_function.test_lambda.arn
  principal     = "events.amazonaws.com"
  source_arn    = aws_cloudwatch_event_rule.cloudwatch_event_is_alive.arn
}

resource "aws_iam_role" "iam_for_lambda" {
  name = "iam_for_lambda"

  assume_role_policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
EOF
}

resource "aws_lambda_function" "test_lambda" {
  filename      = "exports.zip"
  function_name = "lambda_function_name"
  role          = aws_iam_role.iam_for_lambda.arn
  handler       = "exports.test"

  source_code_hash = data.archive_file.init.output_base64sha256

  runtime = "python3.8"
}

data "archive_file" "init" {
  type        = "zip"
  source_file = local_file.foo.filename
  output_path = "exports.zip"

  depends_on = [local_file.foo]
}

resource "local_file" "foo" {
  content  = "def test(): pass"
  filename = "exports.py"
}
$ terraform init
$ terraform apply -auto-approve

Change version = "3.13.0" to version = "3.14.0"

$ terraform init
$ terraform plan
aws_iam_role.iam_for_lambda: Refreshing state... [id=iam_for_lambda]
aws_cloudwatch_event_rule.cloudwatch_event_is_alive: Refreshing state... [id=cer-is_alive]
aws_lambda_function.test_lambda: Refreshing state... [id=lambda_function_name]
aws_lambda_permission.allow_cloudwatch_event_to_call_lamdba_is_alive: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.cloudwatch_event_target_is_alive: Refreshing state... [id=cer-is_alive-lambda_is_alive]

Error: InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, ListTargetsByRuleInput.EventBusName.

Applying from scratch in 3.14.0 works.

I have the same error

Error: InvalidParameter: 1 validation error(s) found.

| - minimum field size of 1, ListTargetsByRuleInput.EventBusName.   |

we’re having the same failure with 3.14.0 and using aws_cloudwatch_event_target

seems to be this update: https://github.com/hashicorp/terraform-provider-aws/pull/15799