1. Packages
  2. Tailscale Provider
  3. API Docs
  4. Webhook
Tailscale v0.19.0 published on Thursday, Apr 10, 2025 by Pulumi

tailscale.Webhook

Explore with Pulumi AI

The webhook resource allows you to configure webhook endpoints for your Tailscale network. See https://tailscale.com/kb/1213/webhooks for more information.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tailscale from "@pulumi/tailscale";

const sampleWebhook = new tailscale.Webhook("sample_webhook", {
    endpointUrl: "https://example.com/webhook/endpoint",
    providerType: "slack",
    subscriptions: [
        "nodeCreated",
        "userDeleted",
    ],
});
Copy
import pulumi
import pulumi_tailscale as tailscale

sample_webhook = tailscale.Webhook("sample_webhook",
    endpoint_url="https://example.com/webhook/endpoint",
    provider_type="slack",
    subscriptions=[
        "nodeCreated",
        "userDeleted",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-tailscale/sdk/go/tailscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tailscale.NewWebhook(ctx, "sample_webhook", &tailscale.WebhookArgs{
			EndpointUrl:  pulumi.String("https://example.com/webhook/endpoint"),
			ProviderType: pulumi.String("slack"),
			Subscriptions: pulumi.StringArray{
				pulumi.String("nodeCreated"),
				pulumi.String("userDeleted"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tailscale = Pulumi.Tailscale;

return await Deployment.RunAsync(() => 
{
    var sampleWebhook = new Tailscale.Webhook("sample_webhook", new()
    {
        EndpointUrl = "https://example.com/webhook/endpoint",
        ProviderType = "slack",
        Subscriptions = new[]
        {
            "nodeCreated",
            "userDeleted",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tailscale.Webhook;
import com.pulumi.tailscale.WebhookArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sampleWebhook = new Webhook("sampleWebhook", WebhookArgs.builder()
            .endpointUrl("https://example.com/webhook/endpoint")
            .providerType("slack")
            .subscriptions(            
                "nodeCreated",
                "userDeleted")
            .build());

    }
}
Copy
resources:
  sampleWebhook:
    type: tailscale:Webhook
    name: sample_webhook
    properties:
      endpointUrl: https://example.com/webhook/endpoint
      providerType: slack
      subscriptions:
        - nodeCreated
        - userDeleted
Copy

Create Webhook Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);
@overload
def Webhook(resource_name: str,
            args: WebhookArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Webhook(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            endpoint_url: Optional[str] = None,
            subscriptions: Optional[Sequence[str]] = None,
            provider_type: Optional[str] = None)
func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)
public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
public Webhook(String name, WebhookArgs args)
public Webhook(String name, WebhookArgs args, CustomResourceOptions options)
type: tailscale:Webhook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var webhookResource = new Tailscale.Webhook("webhookResource", new()
{
    EndpointUrl = "string",
    Subscriptions = new[]
    {
        "string",
    },
    ProviderType = "string",
});
Copy
example, err := tailscale.NewWebhook(ctx, "webhookResource", &tailscale.WebhookArgs{
	EndpointUrl: pulumi.String("string"),
	Subscriptions: pulumi.StringArray{
		pulumi.String("string"),
	},
	ProviderType: pulumi.String("string"),
})
Copy
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
    .endpointUrl("string")
    .subscriptions("string")
    .providerType("string")
    .build());
Copy
webhook_resource = tailscale.Webhook("webhookResource",
    endpoint_url="string",
    subscriptions=["string"],
    provider_type="string")
Copy
const webhookResource = new tailscale.Webhook("webhookResource", {
    endpointUrl: "string",
    subscriptions: ["string"],
    providerType: "string",
});
Copy
type: tailscale:Webhook
properties:
    endpointUrl: string
    providerType: string
    subscriptions:
        - string
Copy

Webhook Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Webhook resource accepts the following input properties:

EndpointUrl
This property is required.
Changes to this property will trigger replacement.
string
The endpoint to send webhook events to.
Subscriptions This property is required. List<string>
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
ProviderType Changes to this property will trigger replacement. string
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
EndpointUrl
This property is required.
Changes to this property will trigger replacement.
string
The endpoint to send webhook events to.
Subscriptions This property is required. []string
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
ProviderType Changes to this property will trigger replacement. string
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
endpointUrl
This property is required.
Changes to this property will trigger replacement.
String
The endpoint to send webhook events to.
subscriptions This property is required. List<String>
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
providerType Changes to this property will trigger replacement. String
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
endpointUrl
This property is required.
Changes to this property will trigger replacement.
string
The endpoint to send webhook events to.
subscriptions This property is required. string[]
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
providerType Changes to this property will trigger replacement. string
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
endpoint_url
This property is required.
Changes to this property will trigger replacement.
str
The endpoint to send webhook events to.
subscriptions This property is required. Sequence[str]
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
provider_type Changes to this property will trigger replacement. str
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
endpointUrl
This property is required.
Changes to this property will trigger replacement.
String
The endpoint to send webhook events to.
subscriptions This property is required. List<String>
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
providerType Changes to this property will trigger replacement. String
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.

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.
Secret string
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
Id string
The provider-assigned unique ID for this managed resource.
Secret string
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
id String
The provider-assigned unique ID for this managed resource.
secret String
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
id string
The provider-assigned unique ID for this managed resource.
secret string
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
id str
The provider-assigned unique ID for this managed resource.
secret str
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
id String
The provider-assigned unique ID for this managed resource.
secret String
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.

Look up 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,
        endpoint_url: Optional[str] = None,
        provider_type: Optional[str] = None,
        secret: Optional[str] = None,
        subscriptions: Optional[Sequence[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)
public static Webhook get(String name, Output<String> id, WebhookState state, CustomResourceOptions options)
resources:  _:    type: tailscale:Webhook    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
EndpointUrl Changes to this property will trigger replacement. string
The endpoint to send webhook events to.
ProviderType Changes to this property will trigger replacement. string
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
Secret string
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
Subscriptions List<string>
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
EndpointUrl Changes to this property will trigger replacement. string
The endpoint to send webhook events to.
ProviderType Changes to this property will trigger replacement. string
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
Secret string
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
Subscriptions []string
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
endpointUrl Changes to this property will trigger replacement. String
The endpoint to send webhook events to.
providerType Changes to this property will trigger replacement. String
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
secret String
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
subscriptions List<String>
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
endpointUrl Changes to this property will trigger replacement. string
The endpoint to send webhook events to.
providerType Changes to this property will trigger replacement. string
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
secret string
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
subscriptions string[]
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
endpoint_url Changes to this property will trigger replacement. str
The endpoint to send webhook events to.
provider_type Changes to this property will trigger replacement. str
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
secret str
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
subscriptions Sequence[str]
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
endpointUrl Changes to this property will trigger replacement. String
The endpoint to send webhook events to.
providerType Changes to this property will trigger replacement. String
The provider type of the endpoint URL. Also referred to as the 'destination' for the webhook in the admin panel. Webhook event payloads are formatted according to the provider type if it is set to a known value. Must be one of slack, mattermost, googlechat, or discord if set.
secret String
The secret used for signing webhook payloads. Only set on resource creation. See https://tailscale.com/kb/1213/webhooks#webhook-secret for more information.
subscriptions List<String>
The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.

Import

Webhooks can be imported using the endpoint id, e.g.,

$ pulumi import tailscale:index/webhook:Webhook sample_webhook 123456789
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
tailscale pulumi/pulumi-tailscale
License
Apache-2.0
Notes
This Pulumi package is based on the tailscale Terraform Provider.