artifactory logo
artifactory v3.1.0, Mar 20 23

artifactory.BuildWebhook

Provides an Artifactory webhook resource. This can be used to register and manage Artifactory webhook subscription which enables you to be notified or notify other users when such events take place in Artifactory.

Example Usage

.

using System.Collections.Generic;
using Pulumi;
using Artifactory = Pulumi.Artifactory;

return await Deployment.RunAsync(() => 
{
    var build_webhook = new Artifactory.BuildWebhook("build-webhook", new()
    {
        Criteria = new Artifactory.Inputs.BuildWebhookCriteriaArgs
        {
            AnyBuild = true,
            ExcludePatterns = new[]
            {
                "bar/**",
            },
            IncludePatterns = new[]
            {
                "foo/**",
            },
            SelectedBuilds = new[]
            {
                "build-id",
            },
        },
        EventTypes = new[]
        {
            "uploaded",
            "deleted",
            "promoted",
        },
        Handlers = new[]
        {
            new Artifactory.Inputs.BuildWebhookHandlerArgs
            {
                CustomHttpHeaders = 
                {
                    { "header-1", "value-1" },
                    { "header-2", "value-2" },
                },
                Proxy = "proxy-key",
                Secret = "some-secret",
                Url = "http://tempurl.org/webhook",
            },
        },
        Key = "build-webhook",
    });

});
package main

import (
	"github.com/pulumi/pulumi-artifactory/sdk/v3/go/artifactory"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := artifactory.NewBuildWebhook(ctx, "build-webhook", &artifactory.BuildWebhookArgs{
			Criteria: &artifactory.BuildWebhookCriteriaArgs{
				AnyBuild: pulumi.Bool(true),
				ExcludePatterns: pulumi.StringArray{
					pulumi.String("bar/**"),
				},
				IncludePatterns: pulumi.StringArray{
					pulumi.String("foo/**"),
				},
				SelectedBuilds: pulumi.StringArray{
					pulumi.String("build-id"),
				},
			},
			EventTypes: pulumi.StringArray{
				pulumi.String("uploaded"),
				pulumi.String("deleted"),
				pulumi.String("promoted"),
			},
			Handlers: artifactory.BuildWebhookHandlerArray{
				&artifactory.BuildWebhookHandlerArgs{
					CustomHttpHeaders: pulumi.StringMap{
						"header-1": pulumi.String("value-1"),
						"header-2": pulumi.String("value-2"),
					},
					Proxy:  pulumi.String("proxy-key"),
					Secret: pulumi.String("some-secret"),
					Url:    pulumi.String("http://tempurl.org/webhook"),
				},
			},
			Key: pulumi.String("build-webhook"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.artifactory.BuildWebhook;
import com.pulumi.artifactory.BuildWebhookArgs;
import com.pulumi.artifactory.inputs.BuildWebhookCriteriaArgs;
import com.pulumi.artifactory.inputs.BuildWebhookHandlerArgs;
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 build_webhook = new BuildWebhook("build-webhook", BuildWebhookArgs.builder()        
            .criteria(BuildWebhookCriteriaArgs.builder()
                .anyBuild(true)
                .excludePatterns("bar/**")
                .includePatterns("foo/**")
                .selectedBuilds("build-id")
                .build())
            .eventTypes(            
                "uploaded",
                "deleted",
                "promoted")
            .handlers(BuildWebhookHandlerArgs.builder()
                .customHttpHeaders(Map.ofEntries(
                    Map.entry("header-1", "value-1"),
                    Map.entry("header-2", "value-2")
                ))
                .proxy("proxy-key")
                .secret("some-secret")
                .url("http://tempurl.org/webhook")
                .build())
            .key("build-webhook")
            .build());

    }
}
import pulumi
import pulumi_artifactory as artifactory

build_webhook = artifactory.BuildWebhook("build-webhook",
    criteria=artifactory.BuildWebhookCriteriaArgs(
        any_build=True,
        exclude_patterns=["bar/**"],
        include_patterns=["foo/**"],
        selected_builds=["build-id"],
    ),
    event_types=[
        "uploaded",
        "deleted",
        "promoted",
    ],
    handlers=[artifactory.BuildWebhookHandlerArgs(
        custom_http_headers={
            "header-1": "value-1",
            "header-2": "value-2",
        },
        proxy="proxy-key",
        secret="some-secret",
        url="http://tempurl.org/webhook",
    )],
    key="build-webhook")
import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";

const build_webhook = new artifactory.BuildWebhook("build-webhook", {
    criteria: {
        anyBuild: true,
        excludePatterns: ["bar/**"],
        includePatterns: ["foo/**"],
        selectedBuilds: ["build-id"],
    },
    eventTypes: [
        "uploaded",
        "deleted",
        "promoted",
    ],
    handlers: [{
        customHttpHeaders: {
            "header-1": "value-1",
            "header-2": "value-2",
        },
        proxy: "proxy-key",
        secret: "some-secret",
        url: "http://tempurl.org/webhook",
    }],
    key: "build-webhook",
});
resources:
  build-webhook:
    type: artifactory:BuildWebhook
    properties:
      criteria:
        anyBuild: true
        excludePatterns:
          - bar/**
        includePatterns:
          - foo/**
        selectedBuilds:
          - build-id
      eventTypes:
        - uploaded
        - deleted
        - promoted
      handlers:
        - customHttpHeaders:
            header-1: value-1
            header-2: value-2
          proxy: proxy-key
          secret: some-secret
          url: http://tempurl.org/webhook
      key: build-webhook

Create BuildWebhook Resource

new BuildWebhook(name: string, args: BuildWebhookArgs, opts?: CustomResourceOptions);
@overload
def BuildWebhook(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 criteria: Optional[BuildWebhookCriteriaArgs] = None,
                 description: Optional[str] = None,
                 enabled: Optional[bool] = None,
                 event_types: Optional[Sequence[str]] = None,
                 handlers: Optional[Sequence[BuildWebhookHandlerArgs]] = None,
                 key: Optional[str] = None)
@overload
def BuildWebhook(resource_name: str,
                 args: BuildWebhookArgs,
                 opts: Optional[ResourceOptions] = None)
func NewBuildWebhook(ctx *Context, name string, args BuildWebhookArgs, opts ...ResourceOption) (*BuildWebhook, error)
public BuildWebhook(string name, BuildWebhookArgs args, CustomResourceOptions? opts = null)
public BuildWebhook(String name, BuildWebhookArgs args)
public BuildWebhook(String name, BuildWebhookArgs args, CustomResourceOptions options)
type: artifactory:BuildWebhook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args BuildWebhookArgs
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 BuildWebhookArgs
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 BuildWebhookArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BuildWebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BuildWebhookArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

EventTypes List<string>

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

Handlers List<BuildWebhookHandlerArgs>

At least one is required.

Key string

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

Description string

Webhook description. Max length 1000 characters.

Enabled bool

Status of webhook. Default to true.

Criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

EventTypes []string

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

Handlers []BuildWebhookHandlerArgs

At least one is required.

Key string

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

Description string

Webhook description. Max length 1000 characters.

Enabled bool

Status of webhook. Default to true.

criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

eventTypes List<String>

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers List<BuildWebhookHandlerArgs>

At least one is required.

key String

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

description String

Webhook description. Max length 1000 characters.

enabled Boolean

Status of webhook. Default to true.

criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

eventTypes string[]

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers BuildWebhookHandlerArgs[]

At least one is required.

key string

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

description string

Webhook description. Max length 1000 characters.

enabled boolean

Status of webhook. Default to true.

criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

event_types Sequence[str]

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers Sequence[BuildWebhookHandlerArgs]

At least one is required.

key str

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

description str

Webhook description. Max length 1000 characters.

enabled bool

Status of webhook. Default to true.

criteria Property Map

Specifies where the webhook will be applied on which repositories.

eventTypes List<String>

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers List<Property Map>

At least one is required.

key String

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

description String

Webhook description. Max length 1000 characters.

enabled Boolean

Status of webhook. Default to true.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing BuildWebhook Resource

Get an existing BuildWebhook 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?: BuildWebhookState, opts?: CustomResourceOptions): BuildWebhook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        criteria: Optional[BuildWebhookCriteriaArgs] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        event_types: Optional[Sequence[str]] = None,
        handlers: Optional[Sequence[BuildWebhookHandlerArgs]] = None,
        key: Optional[str] = None) -> BuildWebhook
func GetBuildWebhook(ctx *Context, name string, id IDInput, state *BuildWebhookState, opts ...ResourceOption) (*BuildWebhook, error)
public static BuildWebhook Get(string name, Input<string> id, BuildWebhookState? state, CustomResourceOptions? opts = null)
public static BuildWebhook get(String name, Output<String> id, BuildWebhookState 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.
The following state arguments are supported:
Criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

Description string

Webhook description. Max length 1000 characters.

Enabled bool

Status of webhook. Default to true.

EventTypes List<string>

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

Handlers List<BuildWebhookHandlerArgs>

At least one is required.

Key string

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

Criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

Description string

Webhook description. Max length 1000 characters.

Enabled bool

Status of webhook. Default to true.

EventTypes []string

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

Handlers []BuildWebhookHandlerArgs

At least one is required.

Key string

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

description String

Webhook description. Max length 1000 characters.

enabled Boolean

Status of webhook. Default to true.

eventTypes List<String>

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers List<BuildWebhookHandlerArgs>

At least one is required.

key String

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

description string

Webhook description. Max length 1000 characters.

enabled boolean

Status of webhook. Default to true.

eventTypes string[]

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers BuildWebhookHandlerArgs[]

At least one is required.

key string

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

criteria BuildWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

description str

Webhook description. Max length 1000 characters.

enabled bool

Status of webhook. Default to true.

event_types Sequence[str]

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers Sequence[BuildWebhookHandlerArgs]

At least one is required.

key str

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

criteria Property Map

Specifies where the webhook will be applied on which repositories.

description String

Webhook description. Max length 1000 characters.

enabled Boolean

Status of webhook. Default to true.

eventTypes List<String>

List of Events in Artifactory, Distribution, Release Bundle that function as the event trigger for the Webhook. Allow values: uploaded, deleted, promoted.

handlers List<Property Map>

At least one is required.

key String

The identity key of the webhook. Must be between 2 and 200 characters. Cannot contain spaces.

Supporting Types

BuildWebhookCriteria

AnyBuild bool

Trigger on any build.

SelectedBuilds List<string>

Trigger on this list of build names.

ExcludePatterns List<string>

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

IncludePatterns List<string>

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

AnyBuild bool

Trigger on any build.

SelectedBuilds []string

Trigger on this list of build names.

ExcludePatterns []string

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

IncludePatterns []string

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

anyBuild Boolean

Trigger on any build.

selectedBuilds List<String>

Trigger on this list of build names.

excludePatterns List<String>

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

includePatterns List<String>

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

anyBuild boolean

Trigger on any build.

selectedBuilds string[]

Trigger on this list of build names.

excludePatterns string[]

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

includePatterns string[]

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

any_build bool

Trigger on any build.

selected_builds Sequence[str]

Trigger on this list of build names.

exclude_patterns Sequence[str]

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

include_patterns Sequence[str]

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

anyBuild Boolean

Trigger on any build.

selectedBuilds List<String>

Trigger on this list of build names.

excludePatterns List<String>

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

includePatterns List<String>

Simple comma separated wildcard patterns for repository artifact paths (with no leading slash). Ant-style path expressions are supported (*, **, ?). For example: org/apache/**.

BuildWebhookHandler

Url string

Specifies the URL that the Webhook invokes. This will be the URL that Artifactory will send an HTTP POST request to.

CustomHttpHeaders Dictionary<string, string>

Custom HTTP headers you wish to use to invoke the Webhook, comprise of key/value pair.

Proxy string

Proxy key from Artifactory UI (Administration > Proxies > Configuration).

Secret string

Secret authentication token that will be sent to the configured URL. The value will be sent as x-jfrog-event-auth header.

Url string

Specifies the URL that the Webhook invokes. This will be the URL that Artifactory will send an HTTP POST request to.

CustomHttpHeaders map[string]string

Custom HTTP headers you wish to use to invoke the Webhook, comprise of key/value pair.

Proxy string

Proxy key from Artifactory UI (Administration > Proxies > Configuration).

Secret string

Secret authentication token that will be sent to the configured URL. The value will be sent as x-jfrog-event-auth header.

url String

Specifies the URL that the Webhook invokes. This will be the URL that Artifactory will send an HTTP POST request to.

customHttpHeaders Map<String,String>

Custom HTTP headers you wish to use to invoke the Webhook, comprise of key/value pair.

proxy String

Proxy key from Artifactory UI (Administration > Proxies > Configuration).

secret String

Secret authentication token that will be sent to the configured URL. The value will be sent as x-jfrog-event-auth header.

url string

Specifies the URL that the Webhook invokes. This will be the URL that Artifactory will send an HTTP POST request to.

customHttpHeaders {[key: string]: string}

Custom HTTP headers you wish to use to invoke the Webhook, comprise of key/value pair.

proxy string

Proxy key from Artifactory UI (Administration > Proxies > Configuration).

secret string

Secret authentication token that will be sent to the configured URL. The value will be sent as x-jfrog-event-auth header.

url str

Specifies the URL that the Webhook invokes. This will be the URL that Artifactory will send an HTTP POST request to.

custom_http_headers Mapping[str, str]

Custom HTTP headers you wish to use to invoke the Webhook, comprise of key/value pair.

proxy str

Proxy key from Artifactory UI (Administration > Proxies > Configuration).

secret str

Secret authentication token that will be sent to the configured URL. The value will be sent as x-jfrog-event-auth header.

url String

Specifies the URL that the Webhook invokes. This will be the URL that Artifactory will send an HTTP POST request to.

customHttpHeaders Map<String>

Custom HTTP headers you wish to use to invoke the Webhook, comprise of key/value pair.

proxy String

Proxy key from Artifactory UI (Administration > Proxies > Configuration).

secret String

Secret authentication token that will be sent to the configured URL. The value will be sent as x-jfrog-event-auth header.

Package Details

Repository
artifactory pulumi/pulumi-artifactory
License
Apache-2.0
Notes

This Pulumi package is based on the artifactory Terraform Provider.