Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add b2_bucket_notification_rules resource and data source #91

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

mlech-reef
Copy link
Collaborator

@mlech-reef mlech-reef commented Nov 3, 2024

Closes #90

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,
  ]
}

@ppolewicz
Copy link
Collaborator

some tests failed

@mlech-reef
Copy link
Collaborator Author

some tests failed

Because the API key doesn't have the proper permissions.

@mlech-reef mlech-reef merged commit 6cf21d6 into master Jan 10, 2025
11 checks passed
@mlech-reef mlech-reef deleted the event-notifications branch January 10, 2025 11:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: B2 Event Notifications
3 participants