Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Webhook

This resource allows you to enable or disable webhooks for a specific vhost and queue.

Only available for dedicated subscription plans.

Dependency

This resource depends on CloudAMQP instance identifier, cloudamqp_instance.instance.id.

Example Usage

using Pulumi;
using CloudAmqp = Pulumi.CloudAmqp;

class MyStack : Stack
{
    public MyStack()
    {
        var webhookQueue = new CloudAmqp.Webhook("webhookQueue", new CloudAmqp.WebhookArgs
        {
            InstanceId = cloudamqp_instance.Instance.Id,
            Vhost = "myvhost",
            Queue = "webhook-queue",
            WebhookUri = "https://example.com/webhook?key=secret",
            RetryInterval = 5,
            Concurrency = 5,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-cloudamqp/sdk/v2/go/cloudamqp"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudamqp.NewWebhook(ctx, "webhookQueue", &cloudamqp.WebhookArgs{
            InstanceId:    pulumi.Any(cloudamqp_instance.Instance.Id),
            Vhost:         pulumi.String("myvhost"),
            Queue:         pulumi.String("webhook-queue"),
            WebhookUri:    pulumi.String("https://example.com/webhook?key=secret"),
            RetryInterval: pulumi.Int(5),
            Concurrency:   pulumi.Int(5),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_cloudamqp as cloudamqp

webhook_queue = cloudamqp.Webhook("webhookQueue",
    instance_id=cloudamqp_instance["instance"]["id"],
    vhost="myvhost",
    queue="webhook-queue",
    webhook_uri="https://example.com/webhook?key=secret",
    retry_interval=5,
    concurrency=5)
import * as pulumi from "@pulumi/pulumi";
import * as cloudamqp from "@pulumi/cloudamqp";

const webhookQueue = new cloudamqp.Webhook("webhookQueue", {
    instanceId: cloudamqp_instance.instance.id,
    vhost: "myvhost",
    queue: "webhook-queue",
    webhookUri: "https://example.com/webhook?key=secret",
    retryInterval: 5,
    concurrency: 5,
});

Create a Webhook Resource

new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);
def Webhook(resource_name: str, opts: Optional[ResourceOptions] = None, concurrency: Optional[int] = None, instance_id: Optional[int] = None, queue: Optional[str] = None, retry_interval: Optional[int] = None, vhost: Optional[str] = None, webhook_uri: Optional[str] = None)
func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)
public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args WebhookArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Webhook Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Webhook resource accepts the following input properties:

Concurrency int

Max simultaneous requests to the endpoint.

InstanceId int

The CloudAMQP instance ID.

Queue string

A (durable) queue on your RabbitMQ instance.

RetryInterval int

How often we retry if your endpoint fails (in seconds).

Vhost string

The vhost the queue resides in.

WebhookUri string

A POST request will be made for each message in the queue to this endpoint.

Concurrency int

Max simultaneous requests to the endpoint.

InstanceId int

The CloudAMQP instance ID.

Queue string

A (durable) queue on your RabbitMQ instance.

RetryInterval int

How often we retry if your endpoint fails (in seconds).

Vhost string

The vhost the queue resides in.

WebhookUri string

A POST request will be made for each message in the queue to this endpoint.

concurrency number

Max simultaneous requests to the endpoint.

instanceId number

The CloudAMQP instance ID.

queue string

A (durable) queue on your RabbitMQ instance.

retryInterval number

How often we retry if your endpoint fails (in seconds).

vhost string

The vhost the queue resides in.

webhookUri string

A POST request will be made for each message in the queue to this endpoint.

concurrency int

Max simultaneous requests to the endpoint.

instance_id int

The CloudAMQP instance ID.

queue str

A (durable) queue on your RabbitMQ instance.

retry_interval int

How often we retry if your endpoint fails (in seconds).

vhost str

The vhost the queue resides in.

webhook_uri str

A POST request will be made for each message in the queue to this endpoint.

Outputs

All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Webhook Resource

Get an existing Webhook resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: WebhookState, opts?: CustomResourceOptions): Webhook
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, concurrency: Optional[int] = None, instance_id: Optional[int] = None, queue: Optional[str] = None, retry_interval: Optional[int] = None, vhost: Optional[str] = None, webhook_uri: Optional[str] = None) -> Webhook
func GetWebhook(ctx *Context, name string, id IDInput, state *WebhookState, opts ...ResourceOption) (*Webhook, error)
public static Webhook Get(string name, Input<string> id, WebhookState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Concurrency int

Max simultaneous requests to the endpoint.

InstanceId int

The CloudAMQP instance ID.

Queue string

A (durable) queue on your RabbitMQ instance.

RetryInterval int

How often we retry if your endpoint fails (in seconds).

Vhost string

The vhost the queue resides in.

WebhookUri string

A POST request will be made for each message in the queue to this endpoint.

Concurrency int

Max simultaneous requests to the endpoint.

InstanceId int

The CloudAMQP instance ID.

Queue string

A (durable) queue on your RabbitMQ instance.

RetryInterval int

How often we retry if your endpoint fails (in seconds).

Vhost string

The vhost the queue resides in.

WebhookUri string

A POST request will be made for each message in the queue to this endpoint.

concurrency number

Max simultaneous requests to the endpoint.

instanceId number

The CloudAMQP instance ID.

queue string

A (durable) queue on your RabbitMQ instance.

retryInterval number

How often we retry if your endpoint fails (in seconds).

vhost string

The vhost the queue resides in.

webhookUri string

A POST request will be made for each message in the queue to this endpoint.

concurrency int

Max simultaneous requests to the endpoint.

instance_id int

The CloudAMQP instance ID.

queue str

A (durable) queue on your RabbitMQ instance.

retry_interval int

How often we retry if your endpoint fails (in seconds).

vhost str

The vhost the queue resides in.

webhook_uri str

A POST request will be made for each message in the queue to this endpoint.

Import

cloudamqp_webhook can be imported using the resource identifier together with CloudAMQP instance identifier. The identifiers are CSV separated, see example below.

 $ pulumi import cloudamqp:index/webhook:Webhook webhook_queue <webhook_id>,<instance_id>`

Package Details

Repository
https://github.com/pulumi/pulumi-cloudamqp
License
Apache-2.0
Notes
This Pulumi package is based on the cloudamqp Terraform Provider.