pulumiservice.Webhook
Explore with Pulumi AI
Pulumi Webhooks allow you to notify external services of events happening within your Pulumi organization or stack. For example, you can trigger a notification whenever a stack is updated. Whenever an event occurs, Pulumi will send an HTTP POST request to all registered webhooks. The webhook can then be used to emit some notification, start running integration tests, or even update additional stacks.
Import
Pulumi webhooks can be imported using the id
, which for webhooks is {org}/{project}/{stack}/{webhook-name}
e.g.,
$ pulumi import pulumiservice:index:Webhook my_webhook my-org/my-project/my-stack/4b0d0671
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,
active: Optional[bool] = None,
display_name: Optional[str] = None,
organization_name: Optional[str] = None,
payload_url: Optional[str] = None,
filters: Optional[Sequence[WebhookFilters]] = None,
format: Optional[WebhookFormat] = None,
project_name: Optional[str] = None,
secret: Optional[str] = None,
stack_name: 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: pulumiservice: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 PulumiService.Webhook("webhookResource", new()
{
Active = false,
DisplayName = "string",
OrganizationName = "string",
PayloadUrl = "string",
Filters = new[]
{
PulumiService.WebhookFilters.StackCreated,
},
Format = PulumiService.WebhookFormat.Raw,
ProjectName = "string",
Secret = "string",
StackName = "string",
});
example, err := pulumiservice.NewWebhook(ctx, "webhookResource", &pulumiservice.WebhookArgs{
Active: pulumi.Bool(false),
DisplayName: pulumi.String("string"),
OrganizationName: pulumi.String("string"),
PayloadUrl: pulumi.String("string"),
Filters: pulumiservice.WebhookFiltersArray{
pulumiservice.WebhookFiltersStackCreated,
},
Format: pulumiservice.WebhookFormatRaw,
ProjectName: pulumi.String("string"),
Secret: pulumi.String("string"),
StackName: pulumi.String("string"),
})
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
.active(false)
.displayName("string")
.organizationName("string")
.payloadUrl("string")
.filters("stack_created")
.format("raw")
.projectName("string")
.secret("string")
.stackName("string")
.build());
webhook_resource = pulumiservice.Webhook("webhookResource",
active=False,
display_name="string",
organization_name="string",
payload_url="string",
filters=[pulumiservice.WebhookFilters.STACK_CREATED],
format=pulumiservice.WebhookFormat.RAW,
project_name="string",
secret="string",
stack_name="string")
const webhookResource = new pulumiservice.Webhook("webhookResource", {
active: false,
displayName: "string",
organizationName: "string",
payloadUrl: "string",
filters: [pulumiservice.WebhookFilters.StackCreated],
format: pulumiservice.WebhookFormat.Raw,
projectName: "string",
secret: "string",
stackName: "string",
});
type: pulumiservice:Webhook
properties:
active: false
displayName: string
filters:
- stack_created
format: raw
organizationName: string
payloadUrl: string
projectName: string
secret: string
stackName: 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:
- Active bool
- Indicates whether this webhook is enabled or not.
- Display
Name string - The friendly name displayed in the Pulumi Cloud.
- Organization
Name string - Name of the organization.
- Payload
Url string - URL to send request to.
- Filters
List<Pulumi.
Pulumi Service. Webhook Filters> - Optional set of filters to apply to the webhook. See webhook docs for more information.
- Format
Pulumi.
Pulumi Service. Webhook Format - Format of the webhook payload. Can be either
raw
orslack
. Defaults toraw
. - Project
Name string - Name of the project. Only needed if this is a stack webhook.
- Secret string
- Optional. secret used as the HMAC key. See webhook docs for more information.
- Stack
Name string - Name of the stack. Only needed if this is a stack webhook.
- Active bool
- Indicates whether this webhook is enabled or not.
- Display
Name string - The friendly name displayed in the Pulumi Cloud.
- Organization
Name string - Name of the organization.
- Payload
Url string - URL to send request to.
- Filters
[]Webhook
Filters - Optional set of filters to apply to the webhook. See webhook docs for more information.
- Format
Webhook
Format - Format of the webhook payload. Can be either
raw
orslack
. Defaults toraw
. - Project
Name string - Name of the project. Only needed if this is a stack webhook.
- Secret string
- Optional. secret used as the HMAC key. See webhook docs for more information.
- Stack
Name string - Name of the stack. Only needed if this is a stack webhook.
- active Boolean
- Indicates whether this webhook is enabled or not.
- display
Name String - The friendly name displayed in the Pulumi Cloud.
- organization
Name String - Name of the organization.
- payload
Url String - URL to send request to.
- filters
List<Webhook
Filters> - Optional set of filters to apply to the webhook. See webhook docs for more information.
- format
Webhook
Format - Format of the webhook payload. Can be either
raw
orslack
. Defaults toraw
. - project
Name String - Name of the project. Only needed if this is a stack webhook.
- secret String
- Optional. secret used as the HMAC key. See webhook docs for more information.
- stack
Name String - Name of the stack. Only needed if this is a stack webhook.
- active boolean
- Indicates whether this webhook is enabled or not.
- display
Name string - The friendly name displayed in the Pulumi Cloud.
- organization
Name string - Name of the organization.
- payload
Url string - URL to send request to.
- filters
Webhook
Filters[] - Optional set of filters to apply to the webhook. See webhook docs for more information.
- format
Webhook
Format - Format of the webhook payload. Can be either
raw
orslack
. Defaults toraw
. - project
Name string - Name of the project. Only needed if this is a stack webhook.
- secret string
- Optional. secret used as the HMAC key. See webhook docs for more information.
- stack
Name string - Name of the stack. Only needed if this is a stack webhook.
- active bool
- Indicates whether this webhook is enabled or not.
- display_
name str - The friendly name displayed in the Pulumi Cloud.
- organization_
name str - Name of the organization.
- payload_
url str - URL to send request to.
- filters
Sequence[Webhook
Filters] - Optional set of filters to apply to the webhook. See webhook docs for more information.
- format
Webhook
Format - Format of the webhook payload. Can be either
raw
orslack
. Defaults toraw
. - project_
name str - Name of the project. Only needed if this is a stack webhook.
- secret str
- Optional. secret used as the HMAC key. See webhook docs for more information.
- stack_
name str - Name of the stack. Only needed if this is a stack webhook.
- active Boolean
- Indicates whether this webhook is enabled or not.
- display
Name String - The friendly name displayed in the Pulumi Cloud.
- organization
Name String - Name of the organization.
- payload
Url String - URL to send request to.
- filters
List<"stack_
created" | "stack_ deleted" | "update_ succeeded" | "update_ failed" | "preview_ succeeded" | "preview_ failed" | "destroy_ succeeded" | "destroy_ failed" | "refresh_ succeeded" | "refresh_ failed" | "deployment_ queued" | "deployment_ started" | "deployment_ succeeded" | "deployment_ failed" | "drift_ detected" | "drift_ detection_ succeeded" | "drift_ detection_ failed" | "drift_ remediation_ succeeded" | "drift_ remediation_ failed"> - Optional set of filters to apply to the webhook. See webhook docs for more information.
- format
"raw" | "slack" | "pulumi_
deployments" | "ms_ teams" - Format of the webhook payload. Can be either
raw
orslack
. Defaults toraw
. - project
Name String - Name of the project. Only needed if this is a stack webhook.
- secret String
- Optional. secret used as the HMAC key. See webhook docs for more information.
- stack
Name String - Name of the stack. Only needed if this is a stack webhook.
Outputs
All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:
Supporting Types
WebhookFilters, WebhookFiltersArgs
- Stack
Created - stack_createdTrigger a webhook when a stack is created. Only valid for org webhooks.
- Stack
Deleted - stack_deletedTrigger a webhook when a stack is deleted. Only valid for org webhooks.
- Update
Succeeded - update_succeededTrigger a webhook when a stack update succeeds.
- Update
Failed - update_failedTrigger a webhook when a stack update fails.
- Preview
Succeeded - preview_succeededTrigger a webhook when a stack preview succeeds.
- Preview
Failed - preview_failedTrigger a webhook when a stack preview fails.
- Destroy
Succeeded - destroy_succeededTrigger a webhook when a stack destroy succeeds.
- Destroy
Failed - destroy_failedTrigger a webhook when a stack destroy fails.
- Refresh
Succeeded - refresh_succeededTrigger a webhook when a stack refresh succeeds.
- Refresh
Failed - refresh_failedTrigger a webhook when a stack refresh fails.
- Deployment
Queued - deployment_queuedTrigger a webhook when a deployment is queued.
- Deployment
Started - deployment_startedTrigger a webhook when a deployment starts running.
- Deployment
Succeeded - deployment_succeededTrigger a webhook when a deployment succeeds.
- Deployment
Failed - deployment_failedTrigger a webhook when a deployment fails.
- Drift
Detected - drift_detectedTrigger a webhook when drift is detected.
- Drift
Detection Succeeded - drift_detection_succeededTrigger a webhook when a drift detection run succeeds, regardless of whether drift is detected.
- Drift
Detection Failed - drift_detection_failedTrigger a webhook when a drift detection run fails.
- Drift
Remediation Succeeded - drift_remediation_succeededTrigger a webhook when a drift remediation run succeeds.
- Drift
Remediation Failed - drift_remediation_failedTrigger a webhook when a drift remediation run fails.
- Webhook
Filters Stack Created - stack_createdTrigger a webhook when a stack is created. Only valid for org webhooks.
- Webhook
Filters Stack Deleted - stack_deletedTrigger a webhook when a stack is deleted. Only valid for org webhooks.
- Webhook
Filters Update Succeeded - update_succeededTrigger a webhook when a stack update succeeds.
- Webhook
Filters Update Failed - update_failedTrigger a webhook when a stack update fails.
- Webhook
Filters Preview Succeeded - preview_succeededTrigger a webhook when a stack preview succeeds.
- Webhook
Filters Preview Failed - preview_failedTrigger a webhook when a stack preview fails.
- Webhook
Filters Destroy Succeeded - destroy_succeededTrigger a webhook when a stack destroy succeeds.
- Webhook
Filters Destroy Failed - destroy_failedTrigger a webhook when a stack destroy fails.
- Webhook
Filters Refresh Succeeded - refresh_succeededTrigger a webhook when a stack refresh succeeds.
- Webhook
Filters Refresh Failed - refresh_failedTrigger a webhook when a stack refresh fails.
- Webhook
Filters Deployment Queued - deployment_queuedTrigger a webhook when a deployment is queued.
- Webhook
Filters Deployment Started - deployment_startedTrigger a webhook when a deployment starts running.
- Webhook
Filters Deployment Succeeded - deployment_succeededTrigger a webhook when a deployment succeeds.
- Webhook
Filters Deployment Failed - deployment_failedTrigger a webhook when a deployment fails.
- Webhook
Filters Drift Detected - drift_detectedTrigger a webhook when drift is detected.
- Webhook
Filters Drift Detection Succeeded - drift_detection_succeededTrigger a webhook when a drift detection run succeeds, regardless of whether drift is detected.
- Webhook
Filters Drift Detection Failed - drift_detection_failedTrigger a webhook when a drift detection run fails.
- Webhook
Filters Drift Remediation Succeeded - drift_remediation_succeededTrigger a webhook when a drift remediation run succeeds.
- Webhook
Filters Drift Remediation Failed - drift_remediation_failedTrigger a webhook when a drift remediation run fails.
- Stack
Created - stack_createdTrigger a webhook when a stack is created. Only valid for org webhooks.
- Stack
Deleted - stack_deletedTrigger a webhook when a stack is deleted. Only valid for org webhooks.
- Update
Succeeded - update_succeededTrigger a webhook when a stack update succeeds.
- Update
Failed - update_failedTrigger a webhook when a stack update fails.
- Preview
Succeeded - preview_succeededTrigger a webhook when a stack preview succeeds.
- Preview
Failed - preview_failedTrigger a webhook when a stack preview fails.
- Destroy
Succeeded - destroy_succeededTrigger a webhook when a stack destroy succeeds.
- Destroy
Failed - destroy_failedTrigger a webhook when a stack destroy fails.
- Refresh
Succeeded - refresh_succeededTrigger a webhook when a stack refresh succeeds.
- Refresh
Failed - refresh_failedTrigger a webhook when a stack refresh fails.
- Deployment
Queued - deployment_queuedTrigger a webhook when a deployment is queued.
- Deployment
Started - deployment_startedTrigger a webhook when a deployment starts running.
- Deployment
Succeeded - deployment_succeededTrigger a webhook when a deployment succeeds.
- Deployment
Failed - deployment_failedTrigger a webhook when a deployment fails.
- Drift
Detected - drift_detectedTrigger a webhook when drift is detected.
- Drift
Detection Succeeded - drift_detection_succeededTrigger a webhook when a drift detection run succeeds, regardless of whether drift is detected.
- Drift
Detection Failed - drift_detection_failedTrigger a webhook when a drift detection run fails.
- Drift
Remediation Succeeded - drift_remediation_succeededTrigger a webhook when a drift remediation run succeeds.
- Drift
Remediation Failed - drift_remediation_failedTrigger a webhook when a drift remediation run fails.
- Stack
Created - stack_createdTrigger a webhook when a stack is created. Only valid for org webhooks.
- Stack
Deleted - stack_deletedTrigger a webhook when a stack is deleted. Only valid for org webhooks.
- Update
Succeeded - update_succeededTrigger a webhook when a stack update succeeds.
- Update
Failed - update_failedTrigger a webhook when a stack update fails.
- Preview
Succeeded - preview_succeededTrigger a webhook when a stack preview succeeds.
- Preview
Failed - preview_failedTrigger a webhook when a stack preview fails.
- Destroy
Succeeded - destroy_succeededTrigger a webhook when a stack destroy succeeds.
- Destroy
Failed - destroy_failedTrigger a webhook when a stack destroy fails.
- Refresh
Succeeded - refresh_succeededTrigger a webhook when a stack refresh succeeds.
- Refresh
Failed - refresh_failedTrigger a webhook when a stack refresh fails.
- Deployment
Queued - deployment_queuedTrigger a webhook when a deployment is queued.
- Deployment
Started - deployment_startedTrigger a webhook when a deployment starts running.
- Deployment
Succeeded - deployment_succeededTrigger a webhook when a deployment succeeds.
- Deployment
Failed - deployment_failedTrigger a webhook when a deployment fails.
- Drift
Detected - drift_detectedTrigger a webhook when drift is detected.
- Drift
Detection Succeeded - drift_detection_succeededTrigger a webhook when a drift detection run succeeds, regardless of whether drift is detected.
- Drift
Detection Failed - drift_detection_failedTrigger a webhook when a drift detection run fails.
- Drift
Remediation Succeeded - drift_remediation_succeededTrigger a webhook when a drift remediation run succeeds.
- Drift
Remediation Failed - drift_remediation_failedTrigger a webhook when a drift remediation run fails.
- STACK_CREATED
- stack_createdTrigger a webhook when a stack is created. Only valid for org webhooks.
- STACK_DELETED
- stack_deletedTrigger a webhook when a stack is deleted. Only valid for org webhooks.
- UPDATE_SUCCEEDED
- update_succeededTrigger a webhook when a stack update succeeds.
- UPDATE_FAILED
- update_failedTrigger a webhook when a stack update fails.
- PREVIEW_SUCCEEDED
- preview_succeededTrigger a webhook when a stack preview succeeds.
- PREVIEW_FAILED
- preview_failedTrigger a webhook when a stack preview fails.
- DESTROY_SUCCEEDED
- destroy_succeededTrigger a webhook when a stack destroy succeeds.
- DESTROY_FAILED
- destroy_failedTrigger a webhook when a stack destroy fails.
- REFRESH_SUCCEEDED
- refresh_succeededTrigger a webhook when a stack refresh succeeds.
- REFRESH_FAILED
- refresh_failedTrigger a webhook when a stack refresh fails.
- DEPLOYMENT_QUEUED
- deployment_queuedTrigger a webhook when a deployment is queued.
- DEPLOYMENT_STARTED
- deployment_startedTrigger a webhook when a deployment starts running.
- DEPLOYMENT_SUCCEEDED
- deployment_succeededTrigger a webhook when a deployment succeeds.
- DEPLOYMENT_FAILED
- deployment_failedTrigger a webhook when a deployment fails.
- DRIFT_DETECTED
- drift_detectedTrigger a webhook when drift is detected.
- DRIFT_DETECTION_SUCCEEDED
- drift_detection_succeededTrigger a webhook when a drift detection run succeeds, regardless of whether drift is detected.
- DRIFT_DETECTION_FAILED
- drift_detection_failedTrigger a webhook when a drift detection run fails.
- DRIFT_REMEDIATION_SUCCEEDED
- drift_remediation_succeededTrigger a webhook when a drift remediation run succeeds.
- DRIFT_REMEDIATION_FAILED
- drift_remediation_failedTrigger a webhook when a drift remediation run fails.
- "stack_
created" - stack_createdTrigger a webhook when a stack is created. Only valid for org webhooks.
- "stack_
deleted" - stack_deletedTrigger a webhook when a stack is deleted. Only valid for org webhooks.
- "update_
succeeded" - update_succeededTrigger a webhook when a stack update succeeds.
- "update_
failed" - update_failedTrigger a webhook when a stack update fails.
- "preview_
succeeded" - preview_succeededTrigger a webhook when a stack preview succeeds.
- "preview_
failed" - preview_failedTrigger a webhook when a stack preview fails.
- "destroy_
succeeded" - destroy_succeededTrigger a webhook when a stack destroy succeeds.
- "destroy_
failed" - destroy_failedTrigger a webhook when a stack destroy fails.
- "refresh_
succeeded" - refresh_succeededTrigger a webhook when a stack refresh succeeds.
- "refresh_
failed" - refresh_failedTrigger a webhook when a stack refresh fails.
- "deployment_
queued" - deployment_queuedTrigger a webhook when a deployment is queued.
- "deployment_
started" - deployment_startedTrigger a webhook when a deployment starts running.
- "deployment_
succeeded" - deployment_succeededTrigger a webhook when a deployment succeeds.
- "deployment_
failed" - deployment_failedTrigger a webhook when a deployment fails.
- "drift_
detected" - drift_detectedTrigger a webhook when drift is detected.
- "drift_
detection_ succeeded" - drift_detection_succeededTrigger a webhook when a drift detection run succeeds, regardless of whether drift is detected.
- "drift_
detection_ failed" - drift_detection_failedTrigger a webhook when a drift detection run fails.
- "drift_
remediation_ succeeded" - drift_remediation_succeededTrigger a webhook when a drift remediation run succeeds.
- "drift_
remediation_ failed" - drift_remediation_failedTrigger a webhook when a drift remediation run fails.
WebhookFormat, WebhookFormatArgs
- Raw
- rawThe default webhook format.
- Slack
- slackMessages formatted for consumption by Slack incoming webhooks.
- Pulumi
Deployments - pulumi_deploymentsInitiate deployments on a stack from a Pulumi Cloud webhook.
- Microsoft
Teams - ms_teamsMessages formatted for consumption by Microsoft Teams incoming webhooks.
- Webhook
Format Raw - rawThe default webhook format.
- Webhook
Format Slack - slackMessages formatted for consumption by Slack incoming webhooks.
- Webhook
Format Pulumi Deployments - pulumi_deploymentsInitiate deployments on a stack from a Pulumi Cloud webhook.
- Webhook
Format Microsoft Teams - ms_teamsMessages formatted for consumption by Microsoft Teams incoming webhooks.
- Raw
- rawThe default webhook format.
- Slack
- slackMessages formatted for consumption by Slack incoming webhooks.
- Pulumi
Deployments - pulumi_deploymentsInitiate deployments on a stack from a Pulumi Cloud webhook.
- Microsoft
Teams - ms_teamsMessages formatted for consumption by Microsoft Teams incoming webhooks.
- Raw
- rawThe default webhook format.
- Slack
- slackMessages formatted for consumption by Slack incoming webhooks.
- Pulumi
Deployments - pulumi_deploymentsInitiate deployments on a stack from a Pulumi Cloud webhook.
- Microsoft
Teams - ms_teamsMessages formatted for consumption by Microsoft Teams incoming webhooks.
- RAW
- rawThe default webhook format.
- SLACK
- slackMessages formatted for consumption by Slack incoming webhooks.
- PULUMI_DEPLOYMENTS
- pulumi_deploymentsInitiate deployments on a stack from a Pulumi Cloud webhook.
- MICROSOFT_TEAMS
- ms_teamsMessages formatted for consumption by Microsoft Teams incoming webhooks.
- "raw"
- rawThe default webhook format.
- "slack"
- slackMessages formatted for consumption by Slack incoming webhooks.
- "pulumi_
deployments" - pulumi_deploymentsInitiate deployments on a stack from a Pulumi Cloud webhook.
- "ms_
teams" - ms_teamsMessages formatted for consumption by Microsoft Teams incoming webhooks.
Package Details
- Repository
- pulumiservice pulumi/pulumi-pulumiservice
- License
- Apache-2.0