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",
],
});
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",
])
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
})
}
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",
},
});
});
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());
}
}
resources:
sampleWebhook:
type: tailscale:Webhook
name: sample_webhook
properties:
endpointUrl: https://example.com/webhook/endpoint
providerType: slack
subscriptions:
- nodeCreated
- userDeleted
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 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.
- args 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 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.
- name String
- The unique name of the resource.
- args 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",
});
example, err := tailscale.NewWebhook(ctx, "webhookResource", &tailscale.WebhookArgs{
EndpointUrl: pulumi.String("string"),
Subscriptions: pulumi.StringArray{
pulumi.String("string"),
},
ProviderType: pulumi.String("string"),
})
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
.endpointUrl("string")
.subscriptions("string")
.providerType("string")
.build());
webhook_resource = tailscale.Webhook("webhookResource",
endpoint_url="string",
subscriptions=["string"],
provider_type="string")
const webhookResource = new tailscale.Webhook("webhookResource", {
endpointUrl: "string",
subscriptions: ["string"],
providerType: "string",
});
type: tailscale:Webhook
properties:
endpointUrl: string
providerType: string
subscriptions:
- string
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:
- Endpoint
Url string - The endpoint to send webhook events to.
- 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.
- Provider
Type 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
, ordiscord
if set.
- Endpoint
Url string - The endpoint to send webhook events to.
- Subscriptions []string
- The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
- Provider
Type 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
, ordiscord
if set.
- endpoint
Url String - The endpoint to send webhook events to.
- 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.
- provider
Type 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
, ordiscord
if set.
- endpoint
Url string - The endpoint to send webhook events to.
- subscriptions string[]
- The Tailscale events to subscribe this webhook to. See https://tailscale.com/kb/1213/webhooks#events for the list of valid events.
- provider
Type 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
, ordiscord
if set.
- endpoint_
url str - The endpoint to send webhook events to.
- 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.
- provider_
type 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
, ordiscord
if set.
- endpoint
Url String - The endpoint to send webhook events to.
- 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.
- provider
Type 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
, ordiscord
if set.
Outputs
All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:
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)
Resource lookup is not supported in YAML
- 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.
- 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.
- Endpoint
Url string - The endpoint to send webhook events to.
- Provider
Type 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
, ordiscord
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.
- Endpoint
Url string - The endpoint to send webhook events to.
- Provider
Type 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
, ordiscord
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 String - The endpoint to send webhook events to.
- provider
Type 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
, ordiscord
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.
- endpoint
Url string - The endpoint to send webhook events to.
- provider
Type 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
, ordiscord
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 str - The endpoint to send webhook events to.
- provider_
type 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
, ordiscord
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.
- endpoint
Url String - The endpoint to send webhook events to.
- provider
Type 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
, ordiscord
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
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.