1. Packages
  2. Bitbucket Provider
  3. API Docs
  4. WorkspaceHook
bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92

bitbucket.WorkspaceHook

Explore with Pulumi AI

bitbucket logo
bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92

    Provides a Bitbucket workspace hook resource.

    This allows you to manage your webhooks on a workspace.

    OAuth2 Scopes: webhook

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as bitbucket from "@pulumi/bitbucket";
    
    const deployOnPush = new bitbucket.WorkspaceHook("deployOnPush", {
        description: "Deploy the code via my webhook",
        events: ["repo:push"],
        url: "https://mywebhookservice.mycompany.com/deploy-on-push",
        workspace: "myteam",
    });
    
    import pulumi
    import pulumi_bitbucket as bitbucket
    
    deploy_on_push = bitbucket.WorkspaceHook("deployOnPush",
        description="Deploy the code via my webhook",
        events=["repo:push"],
        url="https://mywebhookservice.mycompany.com/deploy-on-push",
        workspace="myteam")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/bitbucket/v2/bitbucket"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := bitbucket.NewWorkspaceHook(ctx, "deployOnPush", &bitbucket.WorkspaceHookArgs{
    			Description: pulumi.String("Deploy the code via my webhook"),
    			Events: pulumi.StringArray{
    				pulumi.String("repo:push"),
    			},
    			Url:       pulumi.String("https://mywebhookservice.mycompany.com/deploy-on-push"),
    			Workspace: pulumi.String("myteam"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Bitbucket = Pulumi.Bitbucket;
    
    return await Deployment.RunAsync(() => 
    {
        var deployOnPush = new Bitbucket.WorkspaceHook("deployOnPush", new()
        {
            Description = "Deploy the code via my webhook",
            Events = new[]
            {
                "repo:push",
            },
            Url = "https://mywebhookservice.mycompany.com/deploy-on-push",
            Workspace = "myteam",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.bitbucket.WorkspaceHook;
    import com.pulumi.bitbucket.WorkspaceHookArgs;
    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 deployOnPush = new WorkspaceHook("deployOnPush", WorkspaceHookArgs.builder()
                .description("Deploy the code via my webhook")
                .events("repo:push")
                .url("https://mywebhookservice.mycompany.com/deploy-on-push")
                .workspace("myteam")
                .build());
    
        }
    }
    
    resources:
      deployOnPush:
        type: bitbucket:WorkspaceHook
        properties:
          description: Deploy the code via my webhook
          events:
            - repo:push
          url: https://mywebhookservice.mycompany.com/deploy-on-push
          workspace: myteam
    

    Create WorkspaceHook Resource

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

    Constructor syntax

    new WorkspaceHook(name: string, args: WorkspaceHookArgs, opts?: CustomResourceOptions);
    @overload
    def WorkspaceHook(resource_name: str,
                      args: WorkspaceHookArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkspaceHook(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      description: Optional[str] = None,
                      events: Optional[Sequence[str]] = None,
                      url: Optional[str] = None,
                      workspace: Optional[str] = None,
                      active: Optional[bool] = None,
                      history_enabled: Optional[bool] = None,
                      secret: Optional[str] = None,
                      skip_cert_verification: Optional[bool] = None,
                      workspace_hook_id: Optional[str] = None)
    func NewWorkspaceHook(ctx *Context, name string, args WorkspaceHookArgs, opts ...ResourceOption) (*WorkspaceHook, error)
    public WorkspaceHook(string name, WorkspaceHookArgs args, CustomResourceOptions? opts = null)
    public WorkspaceHook(String name, WorkspaceHookArgs args)
    public WorkspaceHook(String name, WorkspaceHookArgs args, CustomResourceOptions options)
    
    type: bitbucket:WorkspaceHook
    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 WorkspaceHookArgs
    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 WorkspaceHookArgs
    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 WorkspaceHookArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkspaceHookArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkspaceHookArgs
    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 workspaceHookResource = new Bitbucket.WorkspaceHook("workspaceHookResource", new()
    {
        Description = "string",
        Events = new[]
        {
            "string",
        },
        Url = "string",
        Workspace = "string",
        Active = false,
        HistoryEnabled = false,
        Secret = "string",
        SkipCertVerification = false,
        WorkspaceHookId = "string",
    });
    
    example, err := bitbucket.NewWorkspaceHook(ctx, "workspaceHookResource", &bitbucket.WorkspaceHookArgs{
    	Description: pulumi.String("string"),
    	Events: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Url:                  pulumi.String("string"),
    	Workspace:            pulumi.String("string"),
    	Active:               pulumi.Bool(false),
    	HistoryEnabled:       pulumi.Bool(false),
    	Secret:               pulumi.String("string"),
    	SkipCertVerification: pulumi.Bool(false),
    	WorkspaceHookId:      pulumi.String("string"),
    })
    
    var workspaceHookResource = new WorkspaceHook("workspaceHookResource", WorkspaceHookArgs.builder()
        .description("string")
        .events("string")
        .url("string")
        .workspace("string")
        .active(false)
        .historyEnabled(false)
        .secret("string")
        .skipCertVerification(false)
        .workspaceHookId("string")
        .build());
    
    workspace_hook_resource = bitbucket.WorkspaceHook("workspaceHookResource",
        description="string",
        events=["string"],
        url="string",
        workspace="string",
        active=False,
        history_enabled=False,
        secret="string",
        skip_cert_verification=False,
        workspace_hook_id="string")
    
    const workspaceHookResource = new bitbucket.WorkspaceHook("workspaceHookResource", {
        description: "string",
        events: ["string"],
        url: "string",
        workspace: "string",
        active: false,
        historyEnabled: false,
        secret: "string",
        skipCertVerification: false,
        workspaceHookId: "string",
    });
    
    type: bitbucket:WorkspaceHook
    properties:
        active: false
        description: string
        events:
            - string
        historyEnabled: false
        secret: string
        skipCertVerification: false
        url: string
        workspace: string
        workspaceHookId: string
    

    WorkspaceHook 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 WorkspaceHook resource accepts the following input properties:

    Description string
    The name / description to show in the UI.
    Events List<string>
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    Url string
    Where to POST to.
    Workspace string
    The workspace of this repository. Can be you or any team you have write access to.
    Active bool
    Whether the webhook configuration is active or not (Default: true).
    HistoryEnabled bool
    Whether a webhook history is enabled.
    Secret string
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    SkipCertVerification bool
    Whether to skip certificate verification or not (Default: true).
    WorkspaceHookId string
    Description string
    The name / description to show in the UI.
    Events []string
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    Url string
    Where to POST to.
    Workspace string
    The workspace of this repository. Can be you or any team you have write access to.
    Active bool
    Whether the webhook configuration is active or not (Default: true).
    HistoryEnabled bool
    Whether a webhook history is enabled.
    Secret string
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    SkipCertVerification bool
    Whether to skip certificate verification or not (Default: true).
    WorkspaceHookId string
    description String
    The name / description to show in the UI.
    events List<String>
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    url String
    Where to POST to.
    workspace String
    The workspace of this repository. Can be you or any team you have write access to.
    active Boolean
    Whether the webhook configuration is active or not (Default: true).
    historyEnabled Boolean
    Whether a webhook history is enabled.
    secret String
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    skipCertVerification Boolean
    Whether to skip certificate verification or not (Default: true).
    workspaceHookId String
    description string
    The name / description to show in the UI.
    events string[]
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    url string
    Where to POST to.
    workspace string
    The workspace of this repository. Can be you or any team you have write access to.
    active boolean
    Whether the webhook configuration is active or not (Default: true).
    historyEnabled boolean
    Whether a webhook history is enabled.
    secret string
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    skipCertVerification boolean
    Whether to skip certificate verification or not (Default: true).
    workspaceHookId string
    description str
    The name / description to show in the UI.
    events Sequence[str]
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    url str
    Where to POST to.
    workspace str
    The workspace of this repository. Can be you or any team you have write access to.
    active bool
    Whether the webhook configuration is active or not (Default: true).
    history_enabled bool
    Whether a webhook history is enabled.
    secret str
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    skip_cert_verification bool
    Whether to skip certificate verification or not (Default: true).
    workspace_hook_id str
    description String
    The name / description to show in the UI.
    events List<String>
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    url String
    Where to POST to.
    workspace String
    The workspace of this repository. Can be you or any team you have write access to.
    active Boolean
    Whether the webhook configuration is active or not (Default: true).
    historyEnabled Boolean
    Whether a webhook history is enabled.
    secret String
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    skipCertVerification Boolean
    Whether to skip certificate verification or not (Default: true).
    workspaceHookId String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    SecretSet bool
    Whether a webhook secret is set.
    Uuid string
    The UUID of the workspace webhook.
    Id string
    The provider-assigned unique ID for this managed resource.
    SecretSet bool
    Whether a webhook secret is set.
    Uuid string
    The UUID of the workspace webhook.
    id String
    The provider-assigned unique ID for this managed resource.
    secretSet Boolean
    Whether a webhook secret is set.
    uuid String
    The UUID of the workspace webhook.
    id string
    The provider-assigned unique ID for this managed resource.
    secretSet boolean
    Whether a webhook secret is set.
    uuid string
    The UUID of the workspace webhook.
    id str
    The provider-assigned unique ID for this managed resource.
    secret_set bool
    Whether a webhook secret is set.
    uuid str
    The UUID of the workspace webhook.
    id String
    The provider-assigned unique ID for this managed resource.
    secretSet Boolean
    Whether a webhook secret is set.
    uuid String
    The UUID of the workspace webhook.

    Look up Existing WorkspaceHook Resource

    Get an existing WorkspaceHook 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?: WorkspaceHookState, opts?: CustomResourceOptions): WorkspaceHook
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            active: Optional[bool] = None,
            description: Optional[str] = None,
            events: Optional[Sequence[str]] = None,
            history_enabled: Optional[bool] = None,
            secret: Optional[str] = None,
            secret_set: Optional[bool] = None,
            skip_cert_verification: Optional[bool] = None,
            url: Optional[str] = None,
            uuid: Optional[str] = None,
            workspace: Optional[str] = None,
            workspace_hook_id: Optional[str] = None) -> WorkspaceHook
    func GetWorkspaceHook(ctx *Context, name string, id IDInput, state *WorkspaceHookState, opts ...ResourceOption) (*WorkspaceHook, error)
    public static WorkspaceHook Get(string name, Input<string> id, WorkspaceHookState? state, CustomResourceOptions? opts = null)
    public static WorkspaceHook get(String name, Output<String> id, WorkspaceHookState state, CustomResourceOptions options)
    resources:  _:    type: bitbucket:WorkspaceHook    get:      id: ${id}
    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.
    The following state arguments are supported:
    Active bool
    Whether the webhook configuration is active or not (Default: true).
    Description string
    The name / description to show in the UI.
    Events List<string>
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    HistoryEnabled bool
    Whether a webhook history is enabled.
    Secret string
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    SecretSet bool
    Whether a webhook secret is set.
    SkipCertVerification bool
    Whether to skip certificate verification or not (Default: true).
    Url string
    Where to POST to.
    Uuid string
    The UUID of the workspace webhook.
    Workspace string
    The workspace of this repository. Can be you or any team you have write access to.
    WorkspaceHookId string
    Active bool
    Whether the webhook configuration is active or not (Default: true).
    Description string
    The name / description to show in the UI.
    Events []string
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    HistoryEnabled bool
    Whether a webhook history is enabled.
    Secret string
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    SecretSet bool
    Whether a webhook secret is set.
    SkipCertVerification bool
    Whether to skip certificate verification or not (Default: true).
    Url string
    Where to POST to.
    Uuid string
    The UUID of the workspace webhook.
    Workspace string
    The workspace of this repository. Can be you or any team you have write access to.
    WorkspaceHookId string
    active Boolean
    Whether the webhook configuration is active or not (Default: true).
    description String
    The name / description to show in the UI.
    events List<String>
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    historyEnabled Boolean
    Whether a webhook history is enabled.
    secret String
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    secretSet Boolean
    Whether a webhook secret is set.
    skipCertVerification Boolean
    Whether to skip certificate verification or not (Default: true).
    url String
    Where to POST to.
    uuid String
    The UUID of the workspace webhook.
    workspace String
    The workspace of this repository. Can be you or any team you have write access to.
    workspaceHookId String
    active boolean
    Whether the webhook configuration is active or not (Default: true).
    description string
    The name / description to show in the UI.
    events string[]
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    historyEnabled boolean
    Whether a webhook history is enabled.
    secret string
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    secretSet boolean
    Whether a webhook secret is set.
    skipCertVerification boolean
    Whether to skip certificate verification or not (Default: true).
    url string
    Where to POST to.
    uuid string
    The UUID of the workspace webhook.
    workspace string
    The workspace of this repository. Can be you or any team you have write access to.
    workspaceHookId string
    active bool
    Whether the webhook configuration is active or not (Default: true).
    description str
    The name / description to show in the UI.
    events Sequence[str]
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    history_enabled bool
    Whether a webhook history is enabled.
    secret str
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    secret_set bool
    Whether a webhook secret is set.
    skip_cert_verification bool
    Whether to skip certificate verification or not (Default: true).
    url str
    Where to POST to.
    uuid str
    The UUID of the workspace webhook.
    workspace str
    The workspace of this repository. Can be you or any team you have write access to.
    workspace_hook_id str
    active Boolean
    Whether the webhook configuration is active or not (Default: true).
    description String
    The name / description to show in the UI.
    events List<String>
    The events this webhook is subscribed to. Valid values can be found at Bitbucket Webhook Docs.
    historyEnabled Boolean
    Whether a webhook history is enabled.
    secret String
    A Webhook secret value. Passing a null or empty secret or not passing a secret will leave the webhook's secret unset. This value is not returned on read and cannot resolve diffs or be imported as its not returned back from bitbucket API.
    secretSet Boolean
    Whether a webhook secret is set.
    skipCertVerification Boolean
    Whether to skip certificate verification or not (Default: true).
    url String
    Where to POST to.
    uuid String
    The UUID of the workspace webhook.
    workspace String
    The workspace of this repository. Can be you or any team you have write access to.
    workspaceHookId String

    Import

    Hooks can be imported using their workspace/hook-id ID, e.g.

    $ pulumi import bitbucket:index/workspaceHook:WorkspaceHook hook my-account/hook-id
    

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

    Package Details

    Repository
    bitbucket drfaust92/terraform-provider-bitbucket
    License
    Notes
    This Pulumi package is based on the bitbucket Terraform Provider.
    bitbucket logo
    bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92