Skip to content
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

Add support for Redshift Event Target #20256

Merged
merged 6 commits into from
Jul 22, 2021
Merged

Add support for Redshift Event Target #20256

merged 6 commits into from
Jul 22, 2021

Conversation

bill-rich
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #18415

Output from acceptance testing:


@github-actions github-actions bot added service/cloudwatchevents tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. labels Jul 21, 2021
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Jul 21, 2021
@bill-rich bill-rich requested a review from a team July 21, 2021 00:36
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/eventbridge labels Jul 21, 2021
@@ -426,6 +460,12 @@ func resourceAwsCloudWatchEventTargetRead(d *schema.ResourceData, meta interface
d.Set("http_target", nil)
}

if t.RedshiftDataParameters != nil {
if err := d.Set("redshift_target", flattenAwsCloudWatchEventTargetRedshiftParameters(t.RedshiftDataParameters)); err != nil {
return fmt.Errorf("Error setting ecs_target error: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return fmt.Errorf("Error setting ecs_target error: %w", err)
return fmt.Errorf("error setting redshift_target: %w", err)

@ewbankkit ewbankkit self-assigned this Jul 21, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

Commercial
% make testacc TESTARGS='-run=TestAccAWSCloudWatchEventTarget_'                                              
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudWatchEventTarget_ -timeout 180m
=== RUN   TestAccAWSCloudWatchEventTarget_basic
=== PAUSE TestAccAWSCloudWatchEventTarget_basic
=== RUN   TestAccAWSCloudWatchEventTarget_EventBusName
=== PAUSE TestAccAWSCloudWatchEventTarget_EventBusName
=== RUN   TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== PAUSE TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== RUN   TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== PAUSE TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== RUN   TestAccAWSCloudWatchEventTarget_full
=== PAUSE TestAccAWSCloudWatchEventTarget_full
=== RUN   TestAccAWSCloudWatchEventTarget_disappears
=== PAUSE TestAccAWSCloudWatchEventTarget_disappears
=== RUN   TestAccAWSCloudWatchEventTarget_ssmDocument
=== PAUSE TestAccAWSCloudWatchEventTarget_ssmDocument
=== RUN   TestAccAWSCloudWatchEventTarget_http
=== PAUSE TestAccAWSCloudWatchEventTarget_http
=== RUN   TestAccAWSCloudWatchEventTarget_ecs
=== PAUSE TestAccAWSCloudWatchEventTarget_ecs
=== RUN   TestAccAWSCloudWatchEventTarget_redshift
=== PAUSE TestAccAWSCloudWatchEventTarget_redshift
=== RUN   TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType
=== RUN   TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== RUN   TestAccAWSCloudWatchEventTarget_ecsFull
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsFull
=== RUN   TestAccAWSCloudWatchEventTarget_batch
=== PAUSE TestAccAWSCloudWatchEventTarget_batch
=== RUN   TestAccAWSCloudWatchEventTarget_kinesis
=== PAUSE TestAccAWSCloudWatchEventTarget_kinesis
=== RUN   TestAccAWSCloudWatchEventTarget_sqs
=== PAUSE TestAccAWSCloudWatchEventTarget_sqs
=== RUN   TestAccAWSCloudWatchEventTarget_input_transformer
=== PAUSE TestAccAWSCloudWatchEventTarget_input_transformer
=== RUN   TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== PAUSE TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== RUN   TestAccAWSCloudWatchEventTarget_PartnerEventBus
    resource_aws_cloudwatch_event_target_test.go:784: Environment variable EVENT_BRIDGE_PARTNER_EVENT_BUS_NAME is not set
--- SKIP: TestAccAWSCloudWatchEventTarget_PartnerEventBus (0.00s)
=== CONT  TestAccAWSCloudWatchEventTarget_basic
=== CONT  TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType
=== CONT  TestAccAWSCloudWatchEventTarget_disappears
=== CONT  TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== CONT  TestAccAWSCloudWatchEventTarget_kinesis
=== CONT  TestAccAWSCloudWatchEventTarget_batch
=== CONT  TestAccAWSCloudWatchEventTarget_ecsFull
=== CONT  TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== CONT  TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== CONT  TestAccAWSCloudWatchEventTarget_sqs
=== CONT  TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== CONT  TestAccAWSCloudWatchEventTarget_full
=== CONT  TestAccAWSCloudWatchEventTarget_http
=== CONT  TestAccAWSCloudWatchEventTarget_redshift
=== CONT  TestAccAWSCloudWatchEventTarget_input_transformer
=== CONT  TestAccAWSCloudWatchEventTarget_ecs
=== CONT  TestAccAWSCloudWatchEventTarget_ssmDocument
=== CONT  TestAccAWSCloudWatchEventTarget_EventBusName
--- PASS: TestAccAWSCloudWatchEventTarget_disappears (37.68s)
--- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (40.94s)
--- PASS: TestAccAWSCloudWatchEventTarget_sqs (43.03s)
--- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (44.00s)
--- PASS: TestAccAWSCloudWatchEventTarget_http (51.51s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecs (59.74s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecsFull (60.86s)
--- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (64.27s)
--- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (65.65s)
--- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (73.72s)
--- PASS: TestAccAWSCloudWatchEventTarget_basic (75.78s)
--- PASS: TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig (81.19s)
--- PASS: TestAccAWSCloudWatchEventTarget_kinesis (82.64s)
--- PASS: TestAccAWSCloudWatchEventTarget_full (83.67s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType (103.08s)
--- PASS: TestAccAWSCloudWatchEventTarget_batch (162.76s)
--- PASS: TestAccAWSCloudWatchEventTarget_redshift (906.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	911.210s
GovCloud
% make testacc TESTARGS='-run=TestAccAWSCloudWatchEventTarget_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudWatchEventTarget_ -timeout 180m
=== RUN   TestAccAWSCloudWatchEventTarget_basic
=== PAUSE TestAccAWSCloudWatchEventTarget_basic
=== RUN   TestAccAWSCloudWatchEventTarget_EventBusName
=== PAUSE TestAccAWSCloudWatchEventTarget_EventBusName
=== RUN   TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== PAUSE TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== RUN   TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== PAUSE TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== RUN   TestAccAWSCloudWatchEventTarget_full
=== PAUSE TestAccAWSCloudWatchEventTarget_full
=== RUN   TestAccAWSCloudWatchEventTarget_disappears
=== PAUSE TestAccAWSCloudWatchEventTarget_disappears
=== RUN   TestAccAWSCloudWatchEventTarget_ssmDocument
=== PAUSE TestAccAWSCloudWatchEventTarget_ssmDocument
=== RUN   TestAccAWSCloudWatchEventTarget_http
=== PAUSE TestAccAWSCloudWatchEventTarget_http
=== RUN   TestAccAWSCloudWatchEventTarget_ecs
=== PAUSE TestAccAWSCloudWatchEventTarget_ecs
=== RUN   TestAccAWSCloudWatchEventTarget_redshift
=== PAUSE TestAccAWSCloudWatchEventTarget_redshift
=== RUN   TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType
=== RUN   TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== RUN   TestAccAWSCloudWatchEventTarget_ecsFull
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsFull
=== RUN   TestAccAWSCloudWatchEventTarget_batch
=== PAUSE TestAccAWSCloudWatchEventTarget_batch
=== RUN   TestAccAWSCloudWatchEventTarget_kinesis
=== PAUSE TestAccAWSCloudWatchEventTarget_kinesis
=== RUN   TestAccAWSCloudWatchEventTarget_sqs
=== PAUSE TestAccAWSCloudWatchEventTarget_sqs
=== RUN   TestAccAWSCloudWatchEventTarget_input_transformer
=== PAUSE TestAccAWSCloudWatchEventTarget_input_transformer
=== RUN   TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== PAUSE TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== RUN   TestAccAWSCloudWatchEventTarget_PartnerEventBus
    resource_aws_cloudwatch_event_target_test.go:784: Environment variable EVENT_BRIDGE_PARTNER_EVENT_BUS_NAME is not set
--- SKIP: TestAccAWSCloudWatchEventTarget_PartnerEventBus (0.00s)
=== CONT  TestAccAWSCloudWatchEventTarget_basic
=== CONT  TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType
=== CONT  TestAccAWSCloudWatchEventTarget_sqs
=== CONT  TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== CONT  TestAccAWSCloudWatchEventTarget_disappears
=== CONT  TestAccAWSCloudWatchEventTarget_http
=== CONT  TestAccAWSCloudWatchEventTarget_ssmDocument
=== CONT  TestAccAWSCloudWatchEventTarget_redshift
=== CONT  TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== CONT  TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== CONT  TestAccAWSCloudWatchEventTarget_ecs
=== CONT  TestAccAWSCloudWatchEventTarget_batch
=== CONT  TestAccAWSCloudWatchEventTarget_EventBusName
=== CONT  TestAccAWSCloudWatchEventTarget_full
=== CONT  TestAccAWSCloudWatchEventTarget_kinesis
=== CONT  TestAccAWSCloudWatchEventTarget_ecsFull
=== CONT  TestAccAWSCloudWatchEventTarget_input_transformer
=== CONT  TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== CONT  TestAccAWSCloudWatchEventTarget_http
    provider_test.go:1147: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        2021/07/21 09:40:31 [DEBUG] Using modified User-Agent: Terraform/0.12.31 HashiCorp-terraform-exec/0.14.0
        
        Error: Error creating API Gateway: BadRequestException: Endpoint Configuration type EDGE is not supported in this region: us-gov-west-1
        
          on terraform_plugin_test.tf line 25, in resource "aws_api_gateway_rest_api" "test":
          25: resource "aws_api_gateway_rest_api" "test" {
        
        
--- SKIP: TestAccAWSCloudWatchEventTarget_http (27.14s)
--- PASS: TestAccAWSCloudWatchEventTarget_disappears (36.94s)
--- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (41.34s)
--- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (46.22s)
--- PASS: TestAccAWSCloudWatchEventTarget_sqs (47.41s)
=== CONT  TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
    provider_test.go:1104: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        2021/07/21 09:40:30 [DEBUG] Using modified User-Agent: Terraform/0.12.31 HashiCorp-terraform-exec/0.14.0
        
        Error: Creating CloudWatch Events Target failed: UnknownOperationException: Operation is disabled in this region.
        	status code: 400, request id: 9c8c035a-c3f5-4a7e-8da3-09a95791819c
        
          on terraform_plugin_test.tf line 54, in resource "aws_cloudwatch_event_target" "test":
          54: resource "aws_cloudwatch_event_target" "test" {
        
        
--- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (57.65s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecsFull (58.30s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecs (61.04s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount (62.16s)
--- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (64.89s)
--- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (67.97s)
--- SKIP: TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig (70.10s)
--- PASS: TestAccAWSCloudWatchEventTarget_basic (75.93s)
--- PASS: TestAccAWSCloudWatchEventTarget_kinesis (81.69s)
--- PASS: TestAccAWSCloudWatchEventTarget_full (83.18s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankLaunchType (106.74s)
--- PASS: TestAccAWSCloudWatchEventTarget_batch (155.73s)
=== CONT  TestAccAWSCloudWatchEventTarget_redshift
    provider_test.go:1104: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        2021/07/21 10:17:20 [DEBUG] Using modified User-Agent: Terraform/0.12.31 HashiCorp-terraform-exec/0.14.0
        
        Error: Creating CloudWatch Events Target failed: ValidationException: redshift_data is not a supported service for a target.
        	status code: 400, request id: 022d2c67-d6a2-4936-89a0-3ebb76b4665e
        
          on terraform_plugin_test.tf line 95, in resource "aws_cloudwatch_event_target" "test":
          95: resource "aws_cloudwatch_event_target" "test" {
        
        
--- SKIP: TestAccAWSCloudWatchEventTarget_redshift (576.00s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1126.312s

@ewbankkit ewbankkit removed their assignment Jul 22, 2021
@bill-rich bill-rich merged commit 15fa2e0 into main Jul 22, 2021
@bill-rich bill-rich deleted the f-redshift_event_target branch July 22, 2021 20:49
@github-actions github-actions bot added this to the v3.51.0 milestone Jul 22, 2021
github-actions bot pushed a commit that referenced this pull request Jul 22, 2021
@github-actions
Copy link

This functionality has been released in v3.51.0 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. Thank you!

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Redshift Data Targets in EventBridge
2 participants