hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 9k forks source link

[Bug]: Partner Event Bus Name Invalid for `aws_cloudwatch_event_permission` #37693

Open clarkmcc opened 1 month ago

clarkmcc commented 1 month ago

Terraform Core Version

1.8.3

AWS Provider Version

5.50.0

Affected Resource(s)

aws_cloudwatch_event_permission

Expected Behavior

I should be able to use a partner event source in this resource.

resource "aws_cloudwatch_event_bus" "device-changes" {
  name              = "aws.partner/mongodb.com/stitch.trigger/${mongodbatlas_event_trigger.device-changes.trigger_id}"
  event_source_name = "aws.partner/mongodb.com/stitch.trigger/${mongodbatlas_event_trigger.device-changes.trigger_id}"
}

resource "aws_cloudwatch_event_permission" "mongodb_partner_event_source_permission" {
  principal      = "*"
  statement_id   = "Allow_MongoDB_Partner_Event_Source"
  action         = "events:PutEvents"
  event_bus_name = aws_cloudwatch_event_bus.device-changes.name
}

Actual Behavior

Resource fails to create

Relevant Error/Panic Output Snippet

operation error EventBridge: PutPermission, https response error StatusCode: 400, RequestID: xxx, api error ValidationException: 1 validation error detected: Value 'aws.partner/mongodb.com/stitch.trigger/000000000000000000000000' at 'eventBusName' failed to satisfy constraint: Member must satisfy regular expression pattern: [\.\-_A-Za-z0-9]+

Terraform Configuration Files

Provided above ^

Steps to Reproduce

Apply Terraform

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

clarkmcc commented 1 month ago

Related to https://github.com/hashicorp/terraform-provider-aws/issues/25510