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

aws_cloudwatch_event_rule does not support partner event bus for association #18866

Closed
overlordchin opened this issue Apr 14, 2021 · 6 comments
Closed
Labels
bug Addresses a defect in current functionality. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.

Comments

@overlordchin
Copy link

overlordchin commented Apr 14, 2021

resource "aws_cloudwatch_event_rule" "my_fancy_rule" {
name = var.name
description = "placeholder description"
event_pattern = var.event_pattern
event_bus_name = "aws.partner/partnersource/myeventbus"

tags = var.tags

}

Expected behavior - plan indicates a rule resource will be added with the appropriate event_bus associated.

Actual behavior - apply fails with the following error :
Error: Creating CloudWatch Events Rule failed: ResourceNotFoundException: Event bus "aws.partner/partnersource/myeventbus" does not exist

Likely cause - The AWS API does not list partner event buses when listing event buses through the command line. There is a sep command to list and find them despite the resource in the aws console showing "event bus name" and the appropriate value.
IE run aws events list-event-buses (default is shown, partner bus is not)
aws events list-partner-event-source appears to be the appropriate command. If I had to venture a guess the under the hood validation is utilizing this same tech and not finding the partner event bus as a valid bus to associate the rule with.

Terraform version tried: 14.7
aws provider version(s): 3.34 -> 3:36

NOTE - it was not possible to discover this until the regex fix released in 3.34 allowed the partner name to properly validate and not spit out regex violations.

This is very impactful - please properly support partner event buses so that we can create custom rules on our partner event bus to properly filter messages/events

@ghost ghost added service/cloudwatchevents service/cloudwatch Issues and PRs that pertain to the cloudwatch service. labels Apr 14, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 14, 2021
@ewbankkit
Copy link
Contributor

@ewbankkit
Copy link
Contributor

ewbankkit commented Apr 15, 2021

@overlordchin Thanks for raising this issue. This looks similar to #18431 which is being addressed in #18491, but while testing that PR I was able to reference partner event buses.
Once the fix for #18491 is available it will be interesting to see if you get the same error.

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 15, 2021
@overlordchin
Copy link
Author

@ewbankkit great! I will certainly try it when the provider is updated with that fix

@moensch
Copy link
Contributor

moensch commented Apr 21, 2021

I am assuming all these are related, but here's a few issues I've observed with this:

  1. name validation on aws_cloudwatch_event_bus is too strict. I have an event bus currently named aws.partner/somepartner.com/string/uuid-looking-456-string. If I try to create the same via terraform it errors because it doesn't match the ^[a-zA-Z0-9._\\-]+$ regex it expects.
  2. Cannot terraform import an aws_cloudwatch_event_rule that's associated with such a partner bus. The bus/rule syntax doesn't seem to apply (again, I think it's because of the / in the bus name)
Terraform v0.14.10
+ provider registry.terraform.io/hashicorp/aws v3.37.0

@overlordchin
Copy link
Author

I am no longer able to reproduce this with the latest provider version

@github-actions
Copy link

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 have found a problem that seems similar to this, 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 Jul 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Projects
None yet
Development

No branches or pull requests

3 participants