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 EventBridge bus resource policy #16838

Closed
bobthemighty opened this issue Dec 18, 2020 · 2 comments · Fixed by #16874
Closed

AWS EventBridge bus resource policy #16838

bobthemighty opened this issue Dec 18, 2020 · 2 comments · Fixed by #16874
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Milestone

Comments

@bobthemighty
Copy link

Community Note

  • 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.

New or Affected Resource(s)

  • New: aws_cloudwatch_event_bus_policy
  • Replace: aws_cloudwatch_event_permission

Potential Terraform Configuration

resource "aws_cloudwatch_event_bus_policy" "test" {
   event_bus_name = "my-excellent-event-bus"
   policy = some_policy_document.json
}

References

@bobthemighty bobthemighty added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 18, 2020
@ghost ghost added service/cloudwatchevents service/cloudwatch Issues and PRs that pertain to the cloudwatch service. labels Dec 18, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 18, 2020
@ewbankkit ewbankkit removed needs-triage Waiting for first response or review from a maintainer. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. labels Jun 22, 2021
@github-actions github-actions bot added this to the v3.47.0 milestone Jun 22, 2021
@github-actions
Copy link

This functionality has been released in v3.47.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!

@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 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants