vercel.Webhook
Explore with Pulumi AI
A webhook is a trigger-based HTTP endpoint configured to receive HTTP POST requests through events.
When an event happens, a webhook is sent to a third-party app, which can then take appropriate action.
Only Pro and Enterprise teams are able to configure these webhooks at the account level.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vercel from "@pulumiverse/vercel";
const example = new vercel.Project("example", {});
const example2 = new vercel.Project("example2", {});
const withProjectIds = new vercel.Webhook("withProjectIds", {
events: [
"deployment.created",
"deployment.succeeded",
],
endpoint: "https://example.com/endpoint",
projectIds: [
example.id,
example2.id,
],
});
const withoutProjectIds = new vercel.Webhook("withoutProjectIds", {
events: [
"deployment.created",
"deployment.succeeded",
],
endpoint: "https://example.com/endpoint",
});
import pulumi
import pulumiverse_vercel as vercel
example = vercel.Project("example")
example2 = vercel.Project("example2")
with_project_ids = vercel.Webhook("withProjectIds",
events=[
"deployment.created",
"deployment.succeeded",
],
endpoint="https://example.com/endpoint",
project_ids=[
example.id,
example2.id,
])
without_project_ids = vercel.Webhook("withoutProjectIds",
events=[
"deployment.created",
"deployment.succeeded",
],
endpoint="https://example.com/endpoint")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-vercel/sdk/go/vercel"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := vercel.NewProject(ctx, "example", nil)
if err != nil {
return err
}
example2, err := vercel.NewProject(ctx, "example2", nil)
if err != nil {
return err
}
_, err = vercel.NewWebhook(ctx, "withProjectIds", &vercel.WebhookArgs{
Events: pulumi.StringArray{
pulumi.String("deployment.created"),
pulumi.String("deployment.succeeded"),
},
Endpoint: pulumi.String("https://example.com/endpoint"),
ProjectIds: pulumi.StringArray{
example.ID(),
example2.ID(),
},
})
if err != nil {
return err
}
_, err = vercel.NewWebhook(ctx, "withoutProjectIds", &vercel.WebhookArgs{
Events: pulumi.StringArray{
pulumi.String("deployment.created"),
pulumi.String("deployment.succeeded"),
},
Endpoint: pulumi.String("https://example.com/endpoint"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vercel = Pulumiverse.Vercel;
return await Deployment.RunAsync(() =>
{
var example = new Vercel.Project("example");
var example2 = new Vercel.Project("example2");
var withProjectIds = new Vercel.Webhook("withProjectIds", new()
{
Events = new[]
{
"deployment.created",
"deployment.succeeded",
},
Endpoint = "https://example.com/endpoint",
ProjectIds = new[]
{
example.Id,
example2.Id,
},
});
var withoutProjectIds = new Vercel.Webhook("withoutProjectIds", new()
{
Events = new[]
{
"deployment.created",
"deployment.succeeded",
},
Endpoint = "https://example.com/endpoint",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vercel.Project;
import com.pulumi.vercel.Webhook;
import com.pulumi.vercel.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 example = new Project("example");
var example2 = new Project("example2");
var withProjectIds = new Webhook("withProjectIds", WebhookArgs.builder()
.events(
"deployment.created",
"deployment.succeeded")
.endpoint("https://example.com/endpoint")
.projectIds(
example.id(),
example2.id())
.build());
var withoutProjectIds = new Webhook("withoutProjectIds", WebhookArgs.builder()
.events(
"deployment.created",
"deployment.succeeded")
.endpoint("https://example.com/endpoint")
.build());
}
}
resources:
example:
type: vercel:Project
example2:
type: vercel:Project
withProjectIds:
type: vercel:Webhook
properties:
events:
- deployment.created
- deployment.succeeded
endpoint: https://example.com/endpoint
projectIds:
- ${example.id}
- ${example2.id}
withoutProjectIds:
type: vercel:Webhook
properties:
events:
- deployment.created
- deployment.succeeded
endpoint: https://example.com/endpoint
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: Optional[str] = None,
events: Optional[Sequence[str]] = None,
project_ids: Optional[Sequence[str]] = None,
team_id: 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: vercel: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 Vercel.Webhook("webhookResource", new()
{
Endpoint = "string",
Events = new[]
{
"string",
},
ProjectIds = new[]
{
"string",
},
TeamId = "string",
});
example, err := vercel.NewWebhook(ctx, "webhookResource", &vercel.WebhookArgs{
Endpoint: pulumi.String("string"),
Events: pulumi.StringArray{
pulumi.String("string"),
},
ProjectIds: pulumi.StringArray{
pulumi.String("string"),
},
TeamId: pulumi.String("string"),
})
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
.endpoint("string")
.events("string")
.projectIds("string")
.teamId("string")
.build());
webhook_resource = vercel.Webhook("webhookResource",
endpoint="string",
events=["string"],
project_ids=["string"],
team_id="string")
const webhookResource = new vercel.Webhook("webhookResource", {
endpoint: "string",
events: ["string"],
projectIds: ["string"],
teamId: "string",
});
type: vercel:Webhook
properties:
endpoint: string
events:
- string
projectIds:
- string
teamId: 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
The Webhook resource accepts the following input properties:
- Endpoint string
- Webhooks events will be sent as POST requests to this URL.
- Events List<string>
- A list of the events the webhook will listen to. At least one must be present.
- Project
Ids List<string> - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- Team
Id string - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- Endpoint string
- Webhooks events will be sent as POST requests to this URL.
- Events []string
- A list of the events the webhook will listen to. At least one must be present.
- Project
Ids []string - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- Team
Id string - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint String
- Webhooks events will be sent as POST requests to this URL.
- events List<String>
- A list of the events the webhook will listen to. At least one must be present.
- project
Ids List<String> - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- team
Id String - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint string
- Webhooks events will be sent as POST requests to this URL.
- events string[]
- A list of the events the webhook will listen to. At least one must be present.
- project
Ids string[] - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- team
Id string - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint str
- Webhooks events will be sent as POST requests to this URL.
- events Sequence[str]
- A list of the events the webhook will listen to. At least one must be present.
- project_
ids Sequence[str] - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- team_
id str - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint String
- Webhooks events will be sent as POST requests to this URL.
- events List<String>
- A list of the events the webhook will listen to. At least one must be present.
- project
Ids List<String> - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- team
Id String - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
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
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details.
- Id string
- The provider-assigned unique ID for this managed resource.
- Secret string
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details.
- id String
- The provider-assigned unique ID for this managed resource.
- secret String
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details.
- id string
- The provider-assigned unique ID for this managed resource.
- secret string
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details.
- id str
- The provider-assigned unique ID for this managed resource.
- secret str
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details.
- id String
- The provider-assigned unique ID for this managed resource.
- secret String
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details.
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: Optional[str] = None,
events: Optional[Sequence[str]] = None,
project_ids: Optional[Sequence[str]] = None,
secret: Optional[str] = None,
team_id: 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)
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 string
- Webhooks events will be sent as POST requests to this URL.
- Events List<string>
- A list of the events the webhook will listen to. At least one must be present.
- Project
Ids List<string> - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- Secret string
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details. - Team
Id string - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- Endpoint string
- Webhooks events will be sent as POST requests to this URL.
- Events []string
- A list of the events the webhook will listen to. At least one must be present.
- Project
Ids []string - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- Secret string
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details. - Team
Id string - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint String
- Webhooks events will be sent as POST requests to this URL.
- events List<String>
- A list of the events the webhook will listen to. At least one must be present.
- project
Ids List<String> - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- secret String
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details. - team
Id String - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint string
- Webhooks events will be sent as POST requests to this URL.
- events string[]
- A list of the events the webhook will listen to. At least one must be present.
- project
Ids string[] - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- secret string
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details. - team
Id string - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint str
- Webhooks events will be sent as POST requests to this URL.
- events Sequence[str]
- A list of the events the webhook will listen to. At least one must be present.
- project_
ids Sequence[str] - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- secret str
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details. - team_
id str - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
- endpoint String
- Webhooks events will be sent as POST requests to this URL.
- events List<String>
- A list of the events the webhook will listen to. At least one must be present.
- project
Ids List<String> - A list of project IDs that the webhook should be associated with. These projects should send events to the specified endpoint.
- secret String
- A secret value which will be provided in the
x-vercel-signature
header and can be used to verify the authenticity of the webhook. See https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks for further details. - team
Id String - The ID of the team the Webhook should exist under. Required when configuring a team resource if a default team has not been set in the provider.
Package Details
- Repository
- vercel pulumiverse/pulumi-vercel
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vercel
Terraform Provider.