Webhook

class Webhook : KotlinCustomResource

An object that represents a webhook for a container registry. Uses Azure REST API version 2022-12-01. In version 1.x of the Azure Native provider, it used API version 2019-05-01. Other available API versions: 2023-01-01-preview, 2023-06-01-preview, 2023-07-01, 2023-08-01-preview, 2023-11-01-preview, 2024-11-01-preview.

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}

Properties

Link copied to clipboard
val actions: Output<List<String>>

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>

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

Link copied to clipboard
val name: Output<String>

The name of the resource.

Link copied to clipboard

The provisioning state of the webhook at the time the operation was called.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scope: Output<String>?

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 status: Output<String>?

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

Link copied to clipboard

Metadata pertaining to creation and last modification of the resource.

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

The tags of the resource.

Link copied to clipboard
val type: Output<String>

The type of the resource.

Link copied to clipboard
val urn: Output<String>