bitbucket.Hook
Explore with Pulumi AI
Provides a Bitbucket hook resource.
This allows you to manage your webhooks on a repository.
OAuth2 Scopes: webhook
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bitbucket from "@pulumi/bitbucket";
const deployOnPush = new bitbucket.Hook("deployOnPush", {
description: "Deploy the code via my webhook",
events: ["repo:push"],
owner: "myteam",
repository: "terraform-code",
url: "https://mywebhookservice.mycompany.com/deploy-on-push",
});
import pulumi
import pulumi_bitbucket as bitbucket
deploy_on_push = bitbucket.Hook("deployOnPush",
description="Deploy the code via my webhook",
events=["repo:push"],
owner="myteam",
repository="terraform-code",
url="https://mywebhookservice.mycompany.com/deploy-on-push")
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.NewHook(ctx, "deployOnPush", &bitbucket.HookArgs{
Description: pulumi.String("Deploy the code via my webhook"),
Events: pulumi.StringArray{
pulumi.String("repo:push"),
},
Owner: pulumi.String("myteam"),
Repository: pulumi.String("terraform-code"),
Url: pulumi.String("https://mywebhookservice.mycompany.com/deploy-on-push"),
})
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.Hook("deployOnPush", new()
{
Description = "Deploy the code via my webhook",
Events = new[]
{
"repo:push",
},
Owner = "myteam",
Repository = "terraform-code",
Url = "https://mywebhookservice.mycompany.com/deploy-on-push",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.bitbucket.Hook;
import com.pulumi.bitbucket.HookArgs;
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 Hook("deployOnPush", HookArgs.builder()
.description("Deploy the code via my webhook")
.events("repo:push")
.owner("myteam")
.repository("terraform-code")
.url("https://mywebhookservice.mycompany.com/deploy-on-push")
.build());
}
}
resources:
deployOnPush:
type: bitbucket:Hook
properties:
description: Deploy the code via my webhook
events:
- repo:push
owner: myteam
repository: terraform-code
url: https://mywebhookservice.mycompany.com/deploy-on-push
Create Hook Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Hook(name: string, args: HookArgs, opts?: CustomResourceOptions);
@overload
def Hook(resource_name: str,
args: HookArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Hook(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
events: Optional[Sequence[str]] = None,
owner: Optional[str] = None,
repository: Optional[str] = None,
url: Optional[str] = None,
active: Optional[bool] = None,
history_enabled: Optional[bool] = None,
hook_id: Optional[str] = None,
secret: Optional[str] = None,
skip_cert_verification: Optional[bool] = None)
func NewHook(ctx *Context, name string, args HookArgs, opts ...ResourceOption) (*Hook, error)
public Hook(string name, HookArgs args, CustomResourceOptions? opts = null)
type: bitbucket:Hook
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 HookArgs
- 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 HookArgs
- 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 HookArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HookArgs
- 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 hookResource = new Bitbucket.Hook("hookResource", new()
{
Description = "string",
Events = new[]
{
"string",
},
Owner = "string",
Repository = "string",
Url = "string",
Active = false,
HistoryEnabled = false,
HookId = "string",
Secret = "string",
SkipCertVerification = false,
});
example, err := bitbucket.NewHook(ctx, "hookResource", &bitbucket.HookArgs{
Description: pulumi.String("string"),
Events: pulumi.StringArray{
pulumi.String("string"),
},
Owner: pulumi.String("string"),
Repository: pulumi.String("string"),
Url: pulumi.String("string"),
Active: pulumi.Bool(false),
HistoryEnabled: pulumi.Bool(false),
HookId: pulumi.String("string"),
Secret: pulumi.String("string"),
SkipCertVerification: pulumi.Bool(false),
})
var hookResource = new Hook("hookResource", HookArgs.builder()
.description("string")
.events("string")
.owner("string")
.repository("string")
.url("string")
.active(false)
.historyEnabled(false)
.hookId("string")
.secret("string")
.skipCertVerification(false)
.build());
hook_resource = bitbucket.Hook("hookResource",
description="string",
events=["string"],
owner="string",
repository="string",
url="string",
active=False,
history_enabled=False,
hook_id="string",
secret="string",
skip_cert_verification=False)
const hookResource = new bitbucket.Hook("hookResource", {
description: "string",
events: ["string"],
owner: "string",
repository: "string",
url: "string",
active: false,
historyEnabled: false,
hookId: "string",
secret: "string",
skipCertVerification: false,
});
type: bitbucket:Hook
properties:
active: false
description: string
events:
- string
historyEnabled: false
hookId: string
owner: string
repository: string
secret: string
skipCertVerification: false
url: string
Hook 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 Hook 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 Event Payloads Docs.
- Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- Url string
- Where to POST to.
- Active bool
- Whether the webhook configuration is active or not (Default:
true
). - History
Enabled bool - Whether a webhook history is enabled.
- Hook
Id string - 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.
- Skip
Cert boolVerification - Whether to skip certificate verification 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 Event Payloads Docs.
- Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- Url string
- Where to POST to.
- Active bool
- Whether the webhook configuration is active or not (Default:
true
). - History
Enabled bool - Whether a webhook history is enabled.
- Hook
Id string - 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.
- Skip
Cert boolVerification - Whether to skip certificate verification 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 Event Payloads Docs.
- owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- url String
- Where to POST to.
- active Boolean
- Whether the webhook configuration is active or not (Default:
true
). - history
Enabled Boolean - Whether a webhook history is enabled.
- hook
Id String - 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.
- skip
Cert BooleanVerification - Whether to skip certificate verification 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 Event Payloads Docs.
- owner string
- The owner of this repository. Can be you or any team you have write access to.
- repository string
- The name of the repository.
- url string
- Where to POST to.
- active boolean
- Whether the webhook configuration is active or not (Default:
true
). - history
Enabled boolean - Whether a webhook history is enabled.
- hook
Id string - 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.
- skip
Cert booleanVerification - Whether to skip certificate verification 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 Event Payloads Docs.
- owner str
- The owner of this repository. Can be you or any team you have write access to.
- repository str
- The name of the repository.
- url str
- Where to POST to.
- active bool
- Whether the webhook configuration is active or not (Default:
true
). - history_
enabled bool - Whether a webhook history is enabled.
- hook_
id str - 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_ boolverification - Whether to skip certificate verification 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 Event Payloads Docs.
- owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- url String
- Where to POST to.
- active Boolean
- Whether the webhook configuration is active or not (Default:
true
). - history
Enabled Boolean - Whether a webhook history is enabled.
- hook
Id String - 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.
- skip
Cert BooleanVerification - Whether to skip certificate verification or not (Default:
true
).
Outputs
All input properties are implicitly available as output properties. Additionally, the Hook resource produces the following output properties:
- 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.
Look up Existing Hook Resource
Get an existing Hook 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?: HookState, opts?: CustomResourceOptions): Hook
@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,
hook_id: Optional[str] = None,
owner: Optional[str] = None,
repository: Optional[str] = None,
secret: Optional[str] = None,
secret_set: Optional[bool] = None,
skip_cert_verification: Optional[bool] = None,
url: Optional[str] = None,
uuid: Optional[str] = None) -> Hook
func GetHook(ctx *Context, name string, id IDInput, state *HookState, opts ...ResourceOption) (*Hook, error)
public static Hook Get(string name, Input<string> id, HookState? state, CustomResourceOptions? opts = null)
public static Hook get(String name, Output<String> id, HookState state, CustomResourceOptions options)
resources: _: type: bitbucket:Hook 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.
- 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 Event Payloads Docs.
- History
Enabled bool - Whether a webhook history is enabled.
- Hook
Id string - Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- 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.
- Secret
Set bool - Whether a webhook secret is set.
- Skip
Cert boolVerification - Whether to skip certificate verification or not (Default:
true
). - Url string
- Where to POST to.
- Uuid string
- The UUID of the workspace webhook.
- 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 Event Payloads Docs.
- History
Enabled bool - Whether a webhook history is enabled.
- Hook
Id string - Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- 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.
- Secret
Set bool - Whether a webhook secret is set.
- Skip
Cert boolVerification - Whether to skip certificate verification or not (Default:
true
). - Url string
- Where to POST to.
- Uuid string
- The UUID of the workspace webhook.
- 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 Event Payloads Docs.
- history
Enabled Boolean - Whether a webhook history is enabled.
- hook
Id String - owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- 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.
- secret
Set Boolean - Whether a webhook secret is set.
- skip
Cert BooleanVerification - Whether to skip certificate verification or not (Default:
true
). - url String
- Where to POST to.
- uuid String
- The UUID of the workspace webhook.
- 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 Event Payloads Docs.
- history
Enabled boolean - Whether a webhook history is enabled.
- hook
Id string - owner string
- The owner of this repository. Can be you or any team you have write access to.
- repository string
- The name of the repository.
- 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.
- secret
Set boolean - Whether a webhook secret is set.
- skip
Cert booleanVerification - Whether to skip certificate verification or not (Default:
true
). - url string
- Where to POST to.
- uuid string
- The UUID of the workspace webhook.
- 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 Event Payloads Docs.
- history_
enabled bool - Whether a webhook history is enabled.
- hook_
id str - owner str
- The owner of this repository. Can be you or any team you have write access to.
- repository str
- The name of the repository.
- 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_ boolverification - Whether to skip certificate verification or not (Default:
true
). - url str
- Where to POST to.
- uuid str
- The UUID of the workspace webhook.
- 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 Event Payloads Docs.
- history
Enabled Boolean - Whether a webhook history is enabled.
- hook
Id String - owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- 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.
- secret
Set Boolean - Whether a webhook secret is set.
- skip
Cert BooleanVerification - Whether to skip certificate verification or not (Default:
true
). - url String
- Where to POST to.
- uuid String
- The UUID of the workspace webhook.
Import
Hooks can be imported using their owner/repo-name/hook-id
ID, e.g.
$ pulumi import bitbucket:index/hook:Hook hook my-account/my-repo/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.