You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
AWS have added support for resource policies that allow more granular control over who can subscribe or publish to a bus.
They've chosen to expose this behaviour by extending the existing PutPermission action on the eventbridge resource. This API endpoint now accepts either a policy document (the new behaviour), or an action, statement, principal and condition that AWS will merge with the existing resource policy (previous behaviour). Each permission resource effectively becomes a new statement on the policy.
The aws_cloudwatch_event_permission resource is quite constrained, and supports the second, older behaviour. When loading state, the resource parses the policy document and matches statement IDs to figure out which permission resources are present. I'm unable to use this resource as is, because it doesn't support the actions or condition keys that I want to use, but which are supported by the policy language.
If I create the policy manually on my event bus, Terraform is unable to load the bus as a permission resource because it doesn't recognise the actions I've added.
I would like to submit a new aws_cloudwatch_event_bus_policy resource that allows control of the resource policy document directly. This would not be compatible with the existing permission resource. Policies created directly in EventBridge might not be readable as aws_cloudwatch_event_permission resources. I suspect that having direct access to the resource policy means that the aws_cloudwatch_event_permission resource can be fully deprecated.
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.
Community Note
Description
AWS have added support for resource policies that allow more granular control over who can subscribe or publish to a bus.
They've chosen to expose this behaviour by extending the existing PutPermission action on the eventbridge resource. This API endpoint now accepts either a policy document (the new behaviour), or an action, statement, principal and condition that AWS will merge with the existing resource policy (previous behaviour). Each
permission
resource effectively becomes a new statement on the policy.The
aws_cloudwatch_event_permission
resource is quite constrained, and supports the second, older behaviour. When loading state, the resource parses the policy document and matches statement IDs to figure out whichpermission
resources are present. I'm unable to use this resource as is, because it doesn't support the actions or condition keys that I want to use, but which are supported by the policy language.If I create the policy manually on my event bus, Terraform is unable to load the bus as a
permission
resource because it doesn't recognise the actions I've added.I would like to submit a new
aws_cloudwatch_event_bus_policy
resource that allows control of the resource policy document directly. This would not be compatible with the existingpermission
resource. Policies created directly in EventBridge might not be readable asaws_cloudwatch_event_permission
resources. I suspect that having direct access to the resource policy means that theaws_cloudwatch_event_permission
resource can be fully deprecated.New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: