Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_cloudwatch_event_target: Include state upgrade for new d…
…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) ```
- Loading branch information