-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.14.0 Regression: Error: InvalidParameter: 1 validation error(s) found. - minimum field size of 1, ListTargetsByRuleInput.EventBusName. #16069
Comments
Update: Specifying 3.13.0 let my Terraform Plan command and deployment work.
|
I also experience this issue with version 3.14.0 |
Same issue |
we're having the same failure with 3.14.0 and using seems to be this update: #15799 |
Same. |
I have the same error Error: InvalidParameter: 1 validation error(s) found. | - minimum field size of 1, ListTargetsByRuleInput.EventBusName. |
Same error here guys.... Error: InvalidParameter: 1 validation error(s) found.
|
Error: InvalidParameter: 1 validation error(s) found.
|
I have pinned the previous version for now
and it works |
Skipping 3.14.0 fixes my failing pipelines - and should allow for next version up
|
What's the root cause? What's to change in TF code? |
@hostmit You can pin aws provider version |
The bug is not triggered by the unit tests, could someone having an example that triggers it post it so it can be reproduced? |
Root cause is:
I changed it to:
Which includes the source_arn that should be there according to docs.. and also added the qualifier.. to force redeploy |
Same issue here. fixed the provider version to "3.13.0" |
It seems the problem is linked to state migration from 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"
}
Change
Applying from scratch in |
Marking as 3.15.0, but we may release as 3.14.1. |
I have been looking at the differences between the two state file version - the one where the error would be - and the one after I removed the conflicting entries from state and re-ran the workspace in TFE. There is no real change that shows a clear reason why this would happen. some objects are NULL in old state |
This worked for me too. |
If we are going to do the pinning we would need to change this and re-run potentially 300 workspaces. |
Happening to me as well, without lambdas nor cloudwatch-event resources. Error is thrown somewhere around refreshing of |
The resources that I am creating in the module are aws_cloudwatch_event_rule, aws_cloudwatch_event_target, and aws_sns_topic |
…efault event bus name in Read path and only include EventBusName when non-empty in API requests Reference: #16069 Until we sort out the details of setting up the acceptance testing framework to handle state upgrades (likely via Terraform CLI 0.13+ and TestCase.ExternalProviders), manually verified with the following: ```terraform terraform { required_providers { aws = "3.13.0" } required_version = "0.12.29" } provider "aws" { region = "us-east-2" } resource "aws_cloudwatch_event_rule" "test" { name = "16069-test" schedule_expression = "rate(1 hour)" } resource "aws_cloudwatch_event_target" "test" { rule = aws_cloudwatch_event_rule.test.name target_id = "16069-test" arn = aws_sns_topic.test.arn } resource "aws_sns_topic" "test" { name = "16069-test" } ``` ```console $ terraform init $ terraform apply # update version to 3.14.0 $ terraform init $ terraform apply aws_cloudwatch_event_rule.test: Refreshing state... [id=16069-test] aws_sns_topic.test: Refreshing state... [id=arn:aws:sns:us-east-2:--OMITTED--:16069-test] aws_cloudwatch_event_target.test: Refreshing state... [id=16069-test-16069-test] Error: InvalidParameter: 1 validation error(s) found. - minimum field size of 1, ListTargetsByRuleInput.EventBusName. ``` After updating local plugin: ```console $ terraform apply ... Apply complete! Resources: 0 added, 0 changed, 0 destroyed. ``` Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSCloudWatchEventTarget_basic (41.56s) --- PASS: TestAccAWSCloudWatchEventTarget_batch (146.89s) --- PASS: TestAccAWSCloudWatchEventTarget_disappears (15.51s) --- PASS: TestAccAWSCloudWatchEventTarget_ecs (34.45s) --- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount (34.90s) --- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (36.74s) --- PASS: TestAccAWSCloudWatchEventTarget_full (62.30s) --- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (17.97s) --- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (43.71s) --- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (48.88s) --- PASS: TestAccAWSCloudWatchEventTarget_kinesis (62.16s) --- PASS: TestAccAWSCloudWatchEventTarget_sqs (18.22s) --- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (21.40s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSCloudWatchEventTarget_basic (51.37s) --- PASS: TestAccAWSCloudWatchEventTarget_batch (153.85s) --- PASS: TestAccAWSCloudWatchEventTarget_disappears (19.90s) --- PASS: TestAccAWSCloudWatchEventTarget_ecs (40.23s) --- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount (40.10s) --- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (43.57s) --- PASS: TestAccAWSCloudWatchEventTarget_full (67.95s) --- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (22.57s) --- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (49.06s) --- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (39.35s) --- PASS: TestAccAWSCloudWatchEventTarget_kinesis (66.38s) --- PASS: TestAccAWSCloudWatchEventTarget_sqs (22.96s) --- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (25.39s) ```
@bflad this is occurring for us on more then just Cloudwatch Event Target - seeing the error on multiple resources. Cloudwatch events |
@tburow can you please show the Terraform CLI output? |
disreguard - I think im getting scrambled up in teh debug output - I clearly see the event ones - the deeper down the list of the output the more scrabled/interleaved the errors and its not as clear. |
…efault event bus name in Read path and only include EventBusName when non-empty in API requests (#16075) Reference: #16069 Until we sort out the details of setting up the acceptance testing framework to handle state upgrades (likely via Terraform CLI 0.13+ and TestCase.ExternalProviders), manually verified with the following: ```terraform terraform { required_providers { aws = "3.13.0" } required_version = "0.12.29" } provider "aws" { region = "us-east-2" } resource "aws_cloudwatch_event_rule" "test" { name = "16069-test" schedule_expression = "rate(1 hour)" } resource "aws_cloudwatch_event_target" "test" { rule = aws_cloudwatch_event_rule.test.name target_id = "16069-test" arn = aws_sns_topic.test.arn } resource "aws_sns_topic" "test" { name = "16069-test" } ``` ```console $ terraform init $ terraform apply # update version to 3.14.0 $ terraform init $ terraform apply aws_cloudwatch_event_rule.test: Refreshing state... [id=16069-test] aws_sns_topic.test: Refreshing state... [id=arn:aws:sns:us-east-2:--OMITTED--:16069-test] aws_cloudwatch_event_target.test: Refreshing state... [id=16069-test-16069-test] Error: InvalidParameter: 1 validation error(s) found. - minimum field size of 1, ListTargetsByRuleInput.EventBusName. ``` After updating local plugin: ```console $ terraform apply ... Apply complete! Resources: 0 added, 0 changed, 0 destroyed. ``` Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSCloudWatchEventTarget_basic (41.56s) --- PASS: TestAccAWSCloudWatchEventTarget_batch (146.89s) --- PASS: TestAccAWSCloudWatchEventTarget_disappears (15.51s) --- PASS: TestAccAWSCloudWatchEventTarget_ecs (34.45s) --- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount (34.90s) --- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (36.74s) --- PASS: TestAccAWSCloudWatchEventTarget_full (62.30s) --- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (17.97s) --- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (43.71s) --- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (48.88s) --- PASS: TestAccAWSCloudWatchEventTarget_kinesis (62.16s) --- PASS: TestAccAWSCloudWatchEventTarget_sqs (18.22s) --- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (21.40s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSCloudWatchEventTarget_basic (51.37s) --- PASS: TestAccAWSCloudWatchEventTarget_batch (153.85s) --- PASS: TestAccAWSCloudWatchEventTarget_disappears (19.90s) --- PASS: TestAccAWSCloudWatchEventTarget_ecs (40.23s) --- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount (40.10s) --- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (43.57s) --- PASS: TestAccAWSCloudWatchEventTarget_full (67.95s) --- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (22.57s) --- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (49.06s) --- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (39.35s) --- PASS: TestAccAWSCloudWatchEventTarget_kinesis (66.38s) --- PASS: TestAccAWSCloudWatchEventTarget_sqs (22.96s) --- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (25.39s) ```
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. 👍 |
2020-11-06T18:00:19.451Z [DEBUG] plugin.terraform-provider-aws_v3.14.0_x5: 2020/11/06 18:00:19 [DEBUG] [aws-sdk-go] DEBUG: Request sns/GetSubscriptionAttributes Details: |
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! |
Confirm new version (3.14.1) fixed it for us. Thanks for jumping on this quickly team! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
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.
The text was updated successfully, but these errors were encountered: