Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tbroden84 committed Apr 26, 2024
1 parent 3d85e01 commit 33e4555
Showing 1 changed file with 47 additions and 14 deletions.
61 changes: 47 additions & 14 deletions docs/resources/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
layout: "cloudamqp"
page_title: "CloudAMQP: cloudamqp_webhook"
description: |-
Enable or disable webhook for a vhost and queue
Add, update or remove a webhook for a vhost and queue
---

# cloudamqp_webhook

This resource allows you to enable or disable webhooks for a specific vhost and queue.
This resource allows you to add, update or remove a swebhook for a specific vhost and queue.

Only available for dedicated subscription plans.

Expand All @@ -16,21 +16,19 @@ Only available for dedicated subscription plans.
<details>
<summary>
<b>
<i>Enable webhook before v1.30.0</i>
<i>Enable webhook from v1.30.0</i>
</b>
</summary>

Doesn't support updating the resource, makes all argument using `ForceNew` behaviour.
Any changes to an argument will destroy and re-create the resource. Also no longer support
for using `retry_interval` argument in the backend, even though it's set to be required.
Support to updating the resource which makes the argument no longer require `ForceNew` behaviour.
The argument `retry_interval` have also been removed.

```hcl
resource "cloudamqp_webhook" "webhook_queue" {
instance_id = cloudamqp_instance.instance.id
vhost = cloudamqp_instance.instance.vhost
queue = "webhook-queue"
webhook_uri = "https://example.com/webhook?key=secret"
retry_interval = 5
concurrency = 5
}
```
Expand All @@ -40,19 +38,19 @@ resource "cloudamqp_webhook" "webhook_queue" {
<details>
<summary>
<b>
<i>Enable webhook after [v1.30.0](https://github.com/cloudamqp/terraform-provider-cloudamqp/releases/tag/v1.30.0)</i>
<i>Enable webhook before v1.30.0</i>
</b>
</summary>

Support to updating the resource which makes the argument no longer require `ForceNew` behaviour.
The argument `retry_interval` have also been removed.
For more information see below [versions](#Versions) section.

```hcl
resource "cloudamqp_webhook" "webhook_queue" {
instance_id = cloudamqp_instance.instance.id
vhost = cloudamqp_instance.instance.vhost
queue = "webhook-queue"
webhook_uri = "https://example.com/webhook?key=secret"
retry_interval = 5
concurrency = 5
}
```
Expand All @@ -69,10 +67,6 @@ The following arguments are supported:
* `webhook_uri` - (Required) A POST request will be made for each message in the queue to this endpoint.
* `concurrency` - (Required) Max simultaneous requests to the endpoint.

___

* `retry_interval` - ~~(Required)~~ No longer supported in the backend and removed as an argument from v1.30.0. Still required to be set before v1.30.0.

## Attributes Reference

All attributes reference are computed
Expand All @@ -88,3 +82,42 @@ This resource depends on CloudAMQP instance identifier, `cloudamqp_instance.inst
`cloudamqp_webhook` can be imported using the resource identifier together with CloudAMQP instance identifier. The identifiers are CSV separated, see example below.

`terraform import cloudamqp_webhook.webhook_queue <id>,<instance_id>`

## Versions

Important information for older versions

<details>
<summary>
<i>Before v1.30.0</i>
</summary>

Versions before v1.30.0 doesn't support updating the resource, therefore all arguments using the
`ForceNew` behaviour. Any changes to an argument will destroy and re-create the resource. The
argument `retry_interval` is set to required, even if it's no longer supported in the backend.

<b>Example Usage</b>

```hcl
resource "cloudamqp_webhook" "webhook_queue" {
instance_id = cloudamqp_instance.instance.id
vhost = cloudamqp_instance.instance.vhost
queue = "webhook-queue"
webhook_uri = "https://example.com/webhook?key=secret"
retry_interval = 5
concurrency = 5
}
```

<b>Argument Reference</b>

The following arguments are supported:

* `instance_id` - (Required/ForceNew) The CloudAMQP instance ID.
* `vhost` - (Required/ForceNew) The vhost the queue resides in.
* `queue` - (Required/ForceNew) A (durable) queue on your RabbitMQ instance.
* `webhook_uri` - (Required/ForceNew) A POST request will be made for each message in the queue to this endpoint.
* `retry_interval` - (Required/ForceNew) How often we retry if your endpoint fails (in seconds).
* `concurrency` - (Required/ForceNew) Max simultaneous requests to the endpoint.

</details>

0 comments on commit 33e4555

Please sign in to comment.