1. Packages
  2. Artifactory Provider
  3. API Docs
  4. ArtifactLifecycleWebhook
artifactory v8.8.0 published on Friday, Mar 7, 2025 by Pulumi

artifactory.ArtifactLifecycleWebhook

Explore with Pulumi AI

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

.

import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";

const artifact_lifecycle_webhook = new artifactory.ArtifactLifecycleWebhook("artifact-lifecycle-webhook", {
    key: "artifact-lifecycle-webhook",
    eventTypes: [
        "archive",
        "restore",
    ],
    handlers: [{
        url: "http://tempurl.org/webhook",
        secret: "some-secret",
        proxy: "proxy-key",
        customHttpHeaders: {
            "header-1": "value-1",
            "header-2": "value-2",
        },
    }],
});
Copy
import pulumi
import pulumi_artifactory as artifactory

artifact_lifecycle_webhook = artifactory.ArtifactLifecycleWebhook("artifact-lifecycle-webhook",
    key="artifact-lifecycle-webhook",
    event_types=[
        "archive",
        "restore",
    ],
    handlers=[{
        "url": "http://tempurl.org/webhook",
        "secret": "some-secret",
        "proxy": "proxy-key",
        "custom_http_headers": {
            "header-1": "value-1",
            "header-2": "value-2",
        },
    }])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := artifactory.NewArtifactLifecycleWebhook(ctx, "artifact-lifecycle-webhook", &artifactory.ArtifactLifecycleWebhookArgs{
			Key: pulumi.String("artifact-lifecycle-webhook"),
			EventTypes: pulumi.StringArray{
				pulumi.String("archive"),
				pulumi.String("restore"),
			},
			Handlers: artifactory.ArtifactLifecycleWebhookHandlerArray{
				&artifactory.ArtifactLifecycleWebhookHandlerArgs{
					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"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Artifactory = Pulumi.Artifactory;

return await Deployment.RunAsync(() => 
{
    var artifact_lifecycle_webhook = new Artifactory.ArtifactLifecycleWebhook("artifact-lifecycle-webhook", new()
    {
        Key = "artifact-lifecycle-webhook",
        EventTypes = new[]
        {
            "archive",
            "restore",
        },
        Handlers = new[]
        {
            new Artifactory.Inputs.ArtifactLifecycleWebhookHandlerArgs
            {
                Url = "http://tempurl.org/webhook",
                Secret = "some-secret",
                Proxy = "proxy-key",
                CustomHttpHeaders = 
                {
                    { "header-1", "value-1" },
                    { "header-2", "value-2" },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.artifactory.ArtifactLifecycleWebhook;
import com.pulumi.artifactory.ArtifactLifecycleWebhookArgs;
import com.pulumi.artifactory.inputs.ArtifactLifecycleWebhookHandlerArgs;
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 artifact_lifecycle_webhook = new ArtifactLifecycleWebhook("artifact-lifecycle-webhook", ArtifactLifecycleWebhookArgs.builder()
            .key("artifact-lifecycle-webhook")
            .eventTypes(            
                "archive",
                "restore")
            .handlers(ArtifactLifecycleWebhookHandlerArgs.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());

    }
}
Copy
resources:
  artifact-lifecycle-webhook:
    type: artifactory:ArtifactLifecycleWebhook
    properties:
      key: artifact-lifecycle-webhook
      eventTypes:
        - archive
        - restore
      handlers:
        - url: http://tempurl.org/webhook
          secret: some-secret
          proxy: proxy-key
          customHttpHeaders:
            header-1: value-1
            header-2: value-2
Copy

Create ArtifactLifecycleWebhook Resource

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

Constructor syntax

new ArtifactLifecycleWebhook(name: string, args: ArtifactLifecycleWebhookArgs, opts?: CustomResourceOptions);
@overload
def ArtifactLifecycleWebhook(resource_name: str,
                             args: ArtifactLifecycleWebhookArgs,
                             opts: Optional[ResourceOptions] = None)

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

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ArtifactLifecycleWebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ArtifactLifecycleWebhookArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ArtifactLifecycleWebhookArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ArtifactLifecycleWebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ArtifactLifecycleWebhookArgs
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 artifactLifecycleWebhookResource = new Artifactory.ArtifactLifecycleWebhook("artifactLifecycleWebhookResource", new()
{
    EventTypes = new[]
    {
        "string",
    },
    Key = "string",
    Description = "string",
    Enabled = false,
    Handlers = new[]
    {
        new Artifactory.Inputs.ArtifactLifecycleWebhookHandlerArgs
        {
            Url = "string",
            CustomHttpHeaders = 
            {
                { "string", "string" },
            },
            Proxy = "string",
            Secret = "string",
            UseSecretForSigning = false,
        },
    },
});
Copy
example, err := artifactory.NewArtifactLifecycleWebhook(ctx, "artifactLifecycleWebhookResource", &artifactory.ArtifactLifecycleWebhookArgs{
	EventTypes: pulumi.StringArray{
		pulumi.String("string"),
	},
	Key:         pulumi.String("string"),
	Description: pulumi.String("string"),
	Enabled:     pulumi.Bool(false),
	Handlers: artifactory.ArtifactLifecycleWebhookHandlerArray{
		&artifactory.ArtifactLifecycleWebhookHandlerArgs{
			Url: pulumi.String("string"),
			CustomHttpHeaders: pulumi.StringMap{
				"string": pulumi.String("string"),
			},
			Proxy:               pulumi.String("string"),
			Secret:              pulumi.String("string"),
			UseSecretForSigning: pulumi.Bool(false),
		},
	},
})
Copy
var artifactLifecycleWebhookResource = new ArtifactLifecycleWebhook("artifactLifecycleWebhookResource", ArtifactLifecycleWebhookArgs.builder()
    .eventTypes("string")
    .key("string")
    .description("string")
    .enabled(false)
    .handlers(ArtifactLifecycleWebhookHandlerArgs.builder()
        .url("string")
        .customHttpHeaders(Map.of("string", "string"))
        .proxy("string")
        .secret("string")
        .useSecretForSigning(false)
        .build())
    .build());
Copy
artifact_lifecycle_webhook_resource = artifactory.ArtifactLifecycleWebhook("artifactLifecycleWebhookResource",
    event_types=["string"],
    key="string",
    description="string",
    enabled=False,
    handlers=[{
        "url": "string",
        "custom_http_headers": {
            "string": "string",
        },
        "proxy": "string",
        "secret": "string",
        "use_secret_for_signing": False,
    }])
Copy
const artifactLifecycleWebhookResource = new artifactory.ArtifactLifecycleWebhook("artifactLifecycleWebhookResource", {
    eventTypes: ["string"],
    key: "string",
    description: "string",
    enabled: false,
    handlers: [{
        url: "string",
        customHttpHeaders: {
            string: "string",
        },
        proxy: "string",
        secret: "string",
        useSecretForSigning: false,
    }],
});
Copy
type: artifactory:ArtifactLifecycleWebhook
properties:
    description: string
    enabled: false
    eventTypes:
        - string
    handlers:
        - customHttpHeaders:
            string: string
          proxy: string
          secret: string
          url: string
          useSecretForSigning: false
    key: string
Copy

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

EventTypes This property is required. List<string>
List of event triggers for the Webhook. Allow values: archive, restore
Key This property is required. 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
Handlers List<ArtifactLifecycleWebhookHandler>
At least one is required.
EventTypes This property is required. []string
List of event triggers for the Webhook. Allow values: archive, restore
Key This property is required. 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
Handlers []ArtifactLifecycleWebhookHandlerArgs
At least one is required.
eventTypes This property is required. List<String>
List of event triggers for the Webhook. Allow values: archive, restore
key This property is required. 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
handlers List<ArtifactLifecycleWebhookHandler>
At least one is required.
eventTypes This property is required. string[]
List of event triggers for the Webhook. Allow values: archive, restore
key This property is required. 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
handlers ArtifactLifecycleWebhookHandler[]
At least one is required.
event_types This property is required. Sequence[str]
List of event triggers for the Webhook. Allow values: archive, restore
key This property is required. 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
handlers Sequence[ArtifactLifecycleWebhookHandlerArgs]
At least one is required.
eventTypes This property is required. List<String>
List of event triggers for the Webhook. Allow values: archive, restore
key This property is required. 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
handlers List<Property Map>
At least one is required.

Outputs

All input properties are implicitly available as output properties. Additionally, the ArtifactLifecycleWebhook 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 ArtifactLifecycleWebhook Resource

Get an existing ArtifactLifecycleWebhook 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?: ArtifactLifecycleWebhookState, opts?: CustomResourceOptions): ArtifactLifecycleWebhook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        event_types: Optional[Sequence[str]] = None,
        handlers: Optional[Sequence[ArtifactLifecycleWebhookHandlerArgs]] = None,
        key: Optional[str] = None) -> ArtifactLifecycleWebhook
func GetArtifactLifecycleWebhook(ctx *Context, name string, id IDInput, state *ArtifactLifecycleWebhookState, opts ...ResourceOption) (*ArtifactLifecycleWebhook, error)
public static ArtifactLifecycleWebhook Get(string name, Input<string> id, ArtifactLifecycleWebhookState? state, CustomResourceOptions? opts = null)
public static ArtifactLifecycleWebhook get(String name, Output<String> id, ArtifactLifecycleWebhookState state, CustomResourceOptions options)
resources:  _:    type: artifactory:ArtifactLifecycleWebhook    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
Webhook description. Max length 1000 characters.
Enabled bool
Status of webhook. Default to true
EventTypes List<string>
List of event triggers for the Webhook. Allow values: archive, restore
Handlers List<ArtifactLifecycleWebhookHandler>
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
EventTypes []string
List of event triggers for the Webhook. Allow values: archive, restore
Handlers []ArtifactLifecycleWebhookHandlerArgs
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
eventTypes List<String>
List of event triggers for the Webhook. Allow values: archive, restore
handlers List<ArtifactLifecycleWebhookHandler>
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
eventTypes string[]
List of event triggers for the Webhook. Allow values: archive, restore
handlers ArtifactLifecycleWebhookHandler[]
At least one is required.
key string
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
event_types Sequence[str]
List of event triggers for the Webhook. Allow values: archive, restore
handlers Sequence[ArtifactLifecycleWebhookHandlerArgs]
At least one is required.
key str
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
eventTypes List<String>
List of event triggers for the Webhook. Allow values: archive, restore
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

ArtifactLifecycleWebhookHandler
, ArtifactLifecycleWebhookHandlerArgs

Url This property is required. 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.
UseSecretForSigning bool
When set to true, the secret will be used to sign the event payload, allowing the target to validate that the payload content has not been changed and will not be passed as part of the event. If left unset or set to false, the secret is passed through the X-JFrog-Event-Auth HTTP header.
Url This property is required. 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.
UseSecretForSigning bool
When set to true, the secret will be used to sign the event payload, allowing the target to validate that the payload content has not been changed and will not be passed as part of the event. If left unset or set to false, the secret is passed through the X-JFrog-Event-Auth HTTP header.
url This property is required. 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.
useSecretForSigning Boolean
When set to true, the secret will be used to sign the event payload, allowing the target to validate that the payload content has not been changed and will not be passed as part of the event. If left unset or set to false, the secret is passed through the X-JFrog-Event-Auth HTTP header.
url This property is required. 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.
useSecretForSigning boolean
When set to true, the secret will be used to sign the event payload, allowing the target to validate that the payload content has not been changed and will not be passed as part of the event. If left unset or set to false, the secret is passed through the X-JFrog-Event-Auth HTTP header.
url This property is required. 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.
use_secret_for_signing bool
When set to true, the secret will be used to sign the event payload, allowing the target to validate that the payload content has not been changed and will not be passed as part of the event. If left unset or set to false, the secret is passed through the X-JFrog-Event-Auth HTTP header.
url This property is required. 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.
useSecretForSigning Boolean
When set to true, the secret will be used to sign the event payload, allowing the target to validate that the payload content has not been changed and will not be passed as part of the event. If left unset or set to false, the secret is passed through the X-JFrog-Event-Auth HTTP header.

Package Details

Repository
artifactory pulumi/pulumi-artifactory
License
Apache-2.0
Notes
This Pulumi package is based on the artifactory Terraform Provider.