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

Feature request: B2 Event Notifications #90

Open
dotjim opened this issue Oct 28, 2024 · 2 comments · May be fixed by #91
Open

Feature request: B2 Event Notifications #90

dotjim opened this issue Oct 28, 2024 · 2 comments · May be fixed by #91
Assignees
Labels
enhancement New feature or request

Comments

@dotjim
Copy link

dotjim commented Oct 28, 2024

Good day,

Is b2_bucket resource B2 Event Notification support on the roadmap to support via the Terraform plugin? If so, can an approximate timeline be shared?

If there is a workaround to achieve this via the current b2 Terraform plugin we'd be eager to learn more.

Best wishes,

@mlech-reef mlech-reef added the enhancement New feature or request label Oct 29, 2024
@ppolewicz
Copy link
Collaborator

Hi,

Event Notifications are relatively new, the demand for them in th terraform provider wasn't voiced much yet. I think you can work around it by using a custom script execution today, either using b2-sdk-python or even by executing b2 cli commands. It's not as portable as it could be, probably won't run on Windows etc, but if your environment is linux or Mac, it shouldn't be hard, perhaps AI can do most of the work for you.

As for adding Event Notification support to the terraform provider properly, I can't promise if or when it'll be done, but I will take a closer look.

@mlech-reef mlech-reef self-assigned this Oct 31, 2024
@mlech-reef
Copy link
Collaborator

mlech-reef commented Nov 3, 2024

Proposed schema:

resource "b2_bucket_notification_rules" "example" {
  bucket_id = b2_bucket.example.id
  notification_rules {
    name = "test-rule-1"
    event_types = [
      "b2:ObjectCreated:*",
      "b2:ObjectDeleted:*",
    ]
    is_enabled         = true  # optional: default true
    object_name_prefix = ""  # optional, default ""
    target_configuration {  # optional
      target_type                = "webhook"
      url                        = "https://example.com/webhook"
      hmac_sha256_signing_secret = "..." # optional
      custom_headers {  # optional
        name  = "myCustomHeader1"
        value = "myCustomHeaderVal1"
      }
    }
  }
  # is_suspended = false  # computed
  # suspension_reason = ""  # computed
}
data "b2_bucket_notification_rules" "example" {
  bucket_id = b2_bucket.example.bucket_id
  depends_on = [
    b2_bucket_notification_rules.example,
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants