-
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
aws_cloudwatch_event_target does not support cross-account Event Bus #8759
Comments
At first I thought I was running into this because I got the message Careful reading shows that the real issue is that I was trying to go from us-east-1 to us-east-2, which is not supported by AWS. Once I fixed this, cross-account event bus worked just fine. On the event bus destination account:
On the source:
I suggest this issue can be closed. |
Has anyone had any luck on a workaround to this issue? |
Previously I was using the AWS CLI to manually create the event after Terraform-ing the rest of my resources but @fdamstra's suggestion has worked for me now. If anyone wants it, the old snippet I used was
|
@tanasegabriel This is actually not a problem at all. If you take a look at the AWS console, when adding a target to an event rule, and upon selecting "Event bus in another AWS account" you are required to choose an IAM role (either create new or choose existing). The
I initially set the
Hope this helps! |
I am experiencing the same issue. Any hint or workaround this ? |
I had the same issue here trying to target a CodePipeline deployment responding to a CodeCommit push from a different account. The only way to accomplish this right now seems to be talking to the other account's event bus and using the same event rule to pick it up except with the sending account's ID in the event tail. This post here really helped me: https://dev.to/pranitraje/how-to-create-a-codepipeline-with-source-from-another-aws-account-n0m (And don't forget to set the IAM roles and policies as above, either.) HTH |
This PR should fix the issue. |
This functionality has been released in v3.55.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! |
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. |
Community Note
Description
AWS introduced support for cross-account CloudWatch event delivery back in 2017 (an overview can be found here). This works by setting up a CloudWatch event rule on the sender account that filters the events to be sent (better known as
event source
which is usually set up as a JSON pattern - this is supported by the current version of the AWS provider) and setting up a target namedevent bus
. This event bus is located in a different account (recipient) and it requires a dedicated set of permissions (another action that is currently supported Terraform).However, it doesn't seem that defining an event bus located in a different account is supported by aws_cloudwatch_event_target. Adding support for this would mean that all of this intricate set up can be Terraformed.
New or Affected Resource(s)
Potential Terraform Configuration
References
aws_cloudwatch_event_permission
which deals with the set up that needs to be done on the recipient side of things.The text was updated successfully, but these errors were encountered: