WebhookArgs

data class WebhookArgs(val actions: Output<List<Either<String, WebhookAction>>>? = null, val customHeaders: Output<Map<String, String>>? = null, val location: Output<String>? = null, val registryName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val scope: Output<String>? = null, val serviceUri: Output<String>? = null, val status: Output<Either<String, WebhookStatus>>? = null, val tags: Output<Map<String, String>>? = null, val webhookName: Output<String>? = null) : ConvertibleToJava<WebhookArgs>

An object that represents a webhook for a container registry. Uses Azure REST API version 2024-11-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-12-01. Other available API versions: 2019-12-01-preview, 2020-11-01-preview, 2021-06-01-preview, 2021-08-01-preview, 2021-09-01, 2021-12-01-preview, 2022-02-01-preview, 2022-12-01, 2023-01-01-preview, 2023-06-01-preview, 2023-07-01, 2023-08-01-preview, 2023-11-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native containerregistry [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

WebhookCreate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var webhook = new AzureNative.ContainerRegistry.Webhook("webhook", new()
{
Actions = new[]
{
AzureNative.ContainerRegistry.WebhookAction.Push,
},
CustomHeaders =
{
{ "Authorization", "******" },
},
Location = "westus",
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
Scope = "myRepository",
ServiceUri = "http://myservice.com",
Status = AzureNative.ContainerRegistry.WebhookStatus.Enabled,
Tags =
{
{ "key", "value" },
},
WebhookName = "myWebhook",
});
});
package main
import (
containerregistry "github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerregistry.NewWebhook(ctx, "webhook", &containerregistry.WebhookArgs{
Actions: pulumi.StringArray{
pulumi.String(containerregistry.WebhookActionPush),
},
CustomHeaders: pulumi.StringMap{
"Authorization": pulumi.String("******"),
},
Location: pulumi.String("westus"),
RegistryName: pulumi.String("myRegistry"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Scope: pulumi.String("myRepository"),
ServiceUri: pulumi.String("http://myservice.com"),
Status: pulumi.String(containerregistry.WebhookStatusEnabled),
Tags: pulumi.StringMap{
"key": pulumi.String("value"),
},
WebhookName: pulumi.String("myWebhook"),
})
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.azurenative.containerregistry.Webhook;
import com.pulumi.azurenative.containerregistry.WebhookArgs;
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 webhook = new Webhook("webhook", WebhookArgs.builder()
.actions("push")
.customHeaders(Map.of("Authorization", "******"))
.location("westus")
.registryName("myRegistry")
.resourceGroupName("myResourceGroup")
.scope("myRepository")
.serviceUri("http://myservice.com")
.status("enabled")
.tags(Map.of("key", "value"))
.webhookName("myWebhook")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:containerregistry:Webhook myWebhook /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}

Constructors

Link copied to clipboard
constructor(actions: Output<List<Either<String, WebhookAction>>>? = null, customHeaders: Output<Map<String, String>>? = null, location: Output<String>? = null, registryName: Output<String>? = null, resourceGroupName: Output<String>? = null, scope: Output<String>? = null, serviceUri: Output<String>? = null, status: Output<Either<String, WebhookStatus>>? = null, tags: Output<Map<String, String>>? = null, webhookName: Output<String>? = null)

Properties

Link copied to clipboard
val actions: Output<List<Either<String, WebhookAction>>>? = null

The list of actions that trigger the webhook to post notifications.

Link copied to clipboard
val customHeaders: Output<Map<String, String>>? = null

Custom headers that will be added to the webhook notifications.

Link copied to clipboard
val location: Output<String>? = null

The location of the webhook. This cannot be changed after the resource is created.

Link copied to clipboard
val registryName: Output<String>? = null

The name of the container registry.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val scope: Output<String>? = null

The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events.

Link copied to clipboard
val serviceUri: Output<String>? = null

The service URI for the webhook to post notifications.

Link copied to clipboard
val status: Output<Either<String, WebhookStatus>>? = null

The status of the webhook at the time the operation was called.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

The tags for the webhook.

Link copied to clipboard
val webhookName: Output<String>? = null

The name of the webhook.

Functions

Link copied to clipboard
open override fun toJava(): WebhookArgs