Artifactory

Pulumi Official
Package maintained by Pulumi
v2.1.0 published on Monday, May 16, 2022 by Pulumi

DockerWebhook

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 Pulumi;
using Artifactory = Pulumi.Artifactory;

class MyStack : Stack
{
    public MyStack()
    {
        var my_docker_local = new Artifactory.DockerV2Repository("my-docker-local", new Artifactory.DockerV2RepositoryArgs
        {
            Key = "my-docker-local",
        });
        var docker_webhook = new Artifactory.DockerWebhook("docker-webhook", new Artifactory.DockerWebhookArgs
        {
            Key = "docker-webhook",
            EventTypes = 
            {
                "pushed",
                "deleted",
                "promoted",
            },
            Criteria = new Artifactory.Inputs.DockerWebhookCriteriaArgs
            {
                AnyLocal = true,
                AnyRemote = false,
                RepoKeys = 
                {
                    my_docker_local.Key,
                },
                IncludePatterns = 
                {
                    "foo/**",
                },
                ExcludePatterns = 
                {
                    "bar/**",
                },
            },
            Handlers = 
            {
                new Artifactory.Inputs.DockerWebhookHandlerArgs
                {
                    Url = "http://tempurl.org/webhook",
                    Secret = "some-secret",
                    Proxy = "proxy-key",
                    CustomHttpHeaders = 
                    {
                        { "header-1", "value-1" },
                        { "header-2", "value-2" },
                    },
                },
            },
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                my_docker_local,
            },
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := artifactory.NewDockerV2Repository(ctx, "my-docker-local", &artifactory.DockerV2RepositoryArgs{
			Key: pulumi.String("my-docker-local"),
		})
		if err != nil {
			return err
		}
		_, err = artifactory.NewDockerWebhook(ctx, "docker-webhook", &artifactory.DockerWebhookArgs{
			Key: pulumi.String("docker-webhook"),
			EventTypes: pulumi.StringArray{
				pulumi.String("pushed"),
				pulumi.String("deleted"),
				pulumi.String("promoted"),
			},
			Criteria: &DockerWebhookCriteriaArgs{
				AnyLocal:  pulumi.Bool(true),
				AnyRemote: pulumi.Bool(false),
				RepoKeys: pulumi.StringArray{
					my_docker_local.Key,
				},
				IncludePatterns: pulumi.StringArray{
					pulumi.String("foo/**"),
				},
				ExcludePatterns: pulumi.StringArray{
					pulumi.String("bar/**"),
				},
			},
			Handlers: DockerWebhookHandlerArray{
				&DockerWebhookHandlerArgs{
					Url:    pulumi.String("http://tempurl.org/webhook"),
					Secret: pulumi.String("some-secret"),
					Proxy:  pulumi.String("proxy-key"),
					CustomHttpHeaders: pulumi.StringMap{
						"header-1": pulumi.String("value-1"),
						"header-2": pulumi.String("value-2"),
					},
				},
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			my_docker_local,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var my_docker_local = new DockerV2Repository("my-docker-local", DockerV2RepositoryArgs.builder()        
            .key("my-docker-local")
            .build());

        var docker_webhook = new DockerWebhook("docker-webhook", DockerWebhookArgs.builder()        
            .key("docker-webhook")
            .eventTypes(            
                "pushed",
                "deleted",
                "promoted")
            .criteria(DockerWebhookCriteria.builder()
                .anyLocal(true)
                .anyRemote(false)
                .repoKeys(my_docker_local.getKey())
                .includePatterns("foo/**")
                .excludePatterns("bar/**")
                .build())
            .handlers(DockerWebhookHandler.builder()
                .url("http://tempurl.org/webhook")
                .secret("some-secret")
                .proxy("proxy-key")
                .customHttpHeaders(Map.ofEntries(
                    Map.entry("header-1", "value-1"),
                    Map.entry("header-2", "value-2")
                ))
                .build())
            .build());

        }
}
import pulumi
import pulumi_artifactory as artifactory

my_docker_local = artifactory.DockerV2Repository("my-docker-local", key="my-docker-local")
docker_webhook = artifactory.DockerWebhook("docker-webhook",
    key="docker-webhook",
    event_types=[
        "pushed",
        "deleted",
        "promoted",
    ],
    criteria=artifactory.DockerWebhookCriteriaArgs(
        any_local=True,
        any_remote=False,
        repo_keys=[my_docker_local.key],
        include_patterns=["foo/**"],
        exclude_patterns=["bar/**"],
    ),
    handlers=[artifactory.DockerWebhookHandlerArgs(
        url="http://tempurl.org/webhook",
        secret="some-secret",
        proxy="proxy-key",
        custom_http_headers={
            "header-1": "value-1",
            "header-2": "value-2",
        },
    )],
    opts=pulumi.ResourceOptions(depends_on=[my_docker_local]))
import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";

const my_docker_local = new artifactory.DockerV2Repository("my-docker-local", {key: "my-docker-local"});
const docker_webhook = new artifactory.DockerWebhook("docker-webhook", {
    key: "docker-webhook",
    eventTypes: [
        "pushed",
        "deleted",
        "promoted",
    ],
    criteria: {
        anyLocal: true,
        anyRemote: false,
        repoKeys: [my_docker_local.key],
        includePatterns: ["foo/**"],
        excludePatterns: ["bar/**"],
    },
    handlers: [{
        url: "http://tempurl.org/webhook",
        secret: "some-secret",
        proxy: "proxy-key",
        customHttpHeaders: {
            "header-1": "value-1",
            "header-2": "value-2",
        },
    }],
}, {
    dependsOn: [my_docker_local],
});
resources:
  my-docker-local:
    type: artifactory:DockerV2Repository
    properties:
      key: my-docker-local
  docker-webhook:
    type: artifactory:DockerWebhook
    properties:
      key: docker-webhook
      eventTypes:
        - pushed
        - deleted
        - promoted
      criteria:
        anyLocal: true
        anyRemote: false
        repoKeys:
          - ${["my-docker-local"].key}
        includePatterns:
          - foo/**
        excludePatterns:
          - bar/**
      handlers:
        - url: http://tempurl.org/webhook
          secret: some-secret
          proxy: proxy-key
          customHttpHeaders:
            header-1: value-1
            header-2: value-2
    options:
      dependson:
        - ${["my-docker-local"]}

Create a DockerWebhook Resource

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

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

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

Criteria DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

Handlers List<DockerWebhookHandlerArgs>

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 DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

Handlers []DockerWebhookHandlerArgs

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 DockerWebhookCriteriaArgs

Specifies where the webhook will be applied on which repositories.

eventTypes List

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

handlers ListWebhookHandlerArgs>

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 DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

handlers DockerWebhookHandlerArgs[]

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 DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

handlers Sequence[DockerWebhookHandlerArgs]

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

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

handlers List

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 DockerWebhook 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 an Existing DockerWebhook Resource

Get an existing DockerWebhook 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?: DockerWebhookState, opts?: CustomResourceOptions): DockerWebhook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        criteria: Optional[DockerWebhookCriteriaArgs] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        event_types: Optional[Sequence[str]] = None,
        handlers: Optional[Sequence[DockerWebhookHandlerArgs]] = None,
        key: Optional[str] = None) -> DockerWebhook
func GetDockerWebhook(ctx *Context, name string, id IDInput, state *DockerWebhookState, opts ...ResourceOption) (*DockerWebhook, error)
public static DockerWebhook Get(string name, Input<string> id, DockerWebhookState? state, CustomResourceOptions? opts = null)
public static DockerWebhook get(String name, Output<String> id, DockerWebhookState 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 DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

Handlers List<DockerWebhookHandlerArgs>

At least one is required.

Key string

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

Criteria DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

Handlers []DockerWebhookHandlerArgs

At least one is required.

Key string

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

criteria DockerWebhookCriteriaArgs

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

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

handlers ListWebhookHandlerArgs>

At least one is required.

key String

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

criteria DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

handlers DockerWebhookHandlerArgs[]

At least one is required.

key string

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

criteria DockerWebhookCriteriaArgs

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: "pushed", "deleted", "promoted".

handlers Sequence[DockerWebhookHandlerArgs]

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

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

handlers List

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

DockerWebhookCriteria

AnyLocal bool

Trigger on any local repo.

AnyRemote bool

Trigger on any remote repo.

RepoKeys List<string>

Trigger on this list of repo keys.

ExcludePatterns List<string>

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

IncludePatterns List<string>

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

AnyLocal bool

Trigger on any local repo.

AnyRemote bool

Trigger on any remote repo.

RepoKeys []string

Trigger on this list of repo keys.

ExcludePatterns []string

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

IncludePatterns []string

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

anyLocal Boolean

Trigger on any local repo.

anyRemote Boolean

Trigger on any remote repo.

repoKeys List

Trigger on this list of repo keys.

excludePatterns List

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

includePatterns List

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

anyLocal boolean

Trigger on any local repo.

anyRemote boolean

Trigger on any remote repo.

repoKeys string[]

Trigger on this list of repo keys.

excludePatterns string[]

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

includePatterns string[]

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

any_local bool

Trigger on any local repo.

any_remote bool

Trigger on any remote repo.

repo_keys Sequence[str]

Trigger on this list of repo keys.

exclude_patterns Sequence[str]

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

include_patterns Sequence[str]

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

anyLocal Boolean

Trigger on any local repo.

anyRemote Boolean

Trigger on any remote repo.

repoKeys List

Trigger on this list of repo keys.

excludePatterns List

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

includePatterns List

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

DockerWebhookHandler

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

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

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
https://github.com/pulumi/pulumi-artifactory
License
Apache-2.0
Notes

This Pulumi package is based on the artifactory Terraform Provider.