-
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
Add support for API Gateway as an EventBrigde target #19337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @rubenfonseca 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
Co-authored-by: Kit Ewbank <[email protected]>
…tHttpParameters' and 'flattenAwsCloudWatchEventTargetHttpParameters'.
There was a problem hiding this 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 TEST=./aws 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_ecsWithBlankTaskCount
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== 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:673: Environment variable EVENT_BRIDGE_PARTNER_EVENT_BUS_NAME is not set
--- SKIP: TestAccAWSCloudWatchEventTarget_PartnerEventBus (0.00s)
=== CONT TestAccAWSCloudWatchEventTarget_basic
=== CONT TestAccAWSCloudWatchEventTarget_ecs
=== CONT TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== CONT TestAccAWSCloudWatchEventTarget_batch
=== CONT TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== CONT TestAccAWSCloudWatchEventTarget_kinesis
=== CONT TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== CONT TestAccAWSCloudWatchEventTarget_full
=== CONT TestAccAWSCloudWatchEventTarget_sqs
=== CONT TestAccAWSCloudWatchEventTarget_ssmDocument
=== CONT TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== CONT TestAccAWSCloudWatchEventTarget_input_transformer
=== CONT TestAccAWSCloudWatchEventTarget_disappears
=== CONT TestAccAWSCloudWatchEventTarget_http
=== CONT TestAccAWSCloudWatchEventTarget_EventBusName
--- PASS: TestAccAWSCloudWatchEventTarget_disappears (18.97s)
--- PASS: TestAccAWSCloudWatchEventTarget_sqs (19.97s)
--- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (21.23s)
--- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (23.95s)
--- PASS: TestAccAWSCloudWatchEventTarget_http (27.48s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount (37.63s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecs (37.83s)
--- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (38.91s)
--- PASS: TestAccAWSCloudWatchEventTarget_basic (44.32s)
--- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (46.24s)
--- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (55.43s)
--- PASS: TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig (62.67s)
--- PASS: TestAccAWSCloudWatchEventTarget_kinesis (63.73s)
--- PASS: TestAccAWSCloudWatchEventTarget_full (64.03s)
--- PASS: TestAccAWSCloudWatchEventTarget_batch (79.20s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 82.461s
GovCloud
% make testacc TEST=./aws 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_ecsWithBlankTaskCount
=== PAUSE TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== 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:673: Environment variable EVENT_BRIDGE_PARTNER_EVENT_BUS_NAME is not set
--- SKIP: TestAccAWSCloudWatchEventTarget_PartnerEventBus (0.00s)
=== CONT TestAccAWSCloudWatchEventTarget_basic
=== CONT TestAccAWSCloudWatchEventTarget_ecs
=== CONT TestAccAWSCloudWatchEventTarget_inputTransformerJsonString
=== CONT TestAccAWSCloudWatchEventTarget_GeneratedTargetId
=== CONT TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
=== CONT TestAccAWSCloudWatchEventTarget_sqs
=== CONT TestAccAWSCloudWatchEventTarget_kinesis
=== CONT TestAccAWSCloudWatchEventTarget_batch
=== CONT TestAccAWSCloudWatchEventTarget_input_transformer
=== CONT TestAccAWSCloudWatchEventTarget_full
=== CONT TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount
=== CONT TestAccAWSCloudWatchEventTarget_disappears
=== CONT TestAccAWSCloudWatchEventTarget_http
=== CONT TestAccAWSCloudWatchEventTarget_ssmDocument
=== CONT TestAccAWSCloudWatchEventTarget_EventBusName
=== CONT TestAccAWSCloudWatchEventTarget_http
provider_test.go:1115: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
2021/05/12 10:21:28 [DEBUG] Using modified User-Agent: Terraform/0.12.30 HashiCorp-terraform-exec/0.13.3
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 (15.51s)
--- PASS: TestAccAWSCloudWatchEventTarget_disappears (22.77s)
--- PASS: TestAccAWSCloudWatchEventTarget_GeneratedTargetId (25.40s)
--- PASS: TestAccAWSCloudWatchEventTarget_sqs (25.98s)
--- PASS: TestAccAWSCloudWatchEventTarget_ssmDocument (29.15s)
--- PASS: TestAccAWSCloudWatchEventTarget_inputTransformerJsonString (39.36s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecs (40.77s)
--- PASS: TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount (41.01s)
=== CONT TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig
provider_test.go:1115: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
2021/05/12 10:21:28 [DEBUG] Using modified User-Agent: Terraform/0.12.30 HashiCorp-terraform-exec/0.13.3
Error: Creating CloudWatch Events Target failed: UnknownOperationException: Operation is disabled in this region.
status code: 400, request id: 78aaab31-c381-46d6-baec-85898092bfb1
on terraform_plugin_test.tf line 54, in resource "aws_cloudwatch_event_target" "test":
54: resource "aws_cloudwatch_event_target" "test" {
--- PASS: TestAccAWSCloudWatchEventTarget_EventBusName (45.35s)
--- PASS: TestAccAWSCloudWatchEventTarget_input_transformer (48.63s)
--- PASS: TestAccAWSCloudWatchEventTarget_basic (53.12s)
--- SKIP: TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig (57.95s)
--- PASS: TestAccAWSCloudWatchEventTarget_kinesis (68.87s)
--- PASS: TestAccAWSCloudWatchEventTarget_full (69.49s)
--- PASS: TestAccAWSCloudWatchEventTarget_batch (141.53s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 144.461s
@rubenfonseca Thanks for the contribution 👏. |
Thank you so much for your help! It was my first time with this code based, and I've already learned a lot about the conventions. Thank you! |
This has been released in version 3.40.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 for triage. Thanks! |
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. |
Community Note
Closes #16624
Output from acceptance testing: