azure-native.containerregistry.Webhook
Explore with Pulumi AI
An object that represents a webhook for a container registry. Azure REST API version: 2022-12-01. Prior API version in Azure Native 1.x: 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 * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const webhook = new azure_native.containerregistry.Webhook("webhook", {
    actions: [azure_native.containerregistry.WebhookAction.Push],
    customHeaders: {
        Authorization: "******",
    },
    location: "westus",
    registryName: "myRegistry",
    resourceGroupName: "myResourceGroup",
    scope: "myRepository",
    serviceUri: "http://myservice.com",
    status: azure_native.containerregistry.WebhookStatus.Enabled,
    tags: {
        key: "value",
    },
    webhookName: "myWebhook",
});
import pulumi
import pulumi_azure_native as azure_native
webhook = azure_native.containerregistry.Webhook("webhook",
    actions=[azure_native.containerregistry.WebhookAction.PUSH],
    custom_headers={
        "Authorization": "******",
    },
    location="westus",
    registry_name="myRegistry",
    resource_group_name="myResourceGroup",
    scope="myRepository",
    service_uri="http://myservice.com",
    status=azure_native.containerregistry.WebhookStatus.ENABLED,
    tags={
        "key": "value",
    },
    webhook_name="myWebhook")
resources:
  webhook:
    type: azure-native:containerregistry:Webhook
    properties:
      actions:
        - push
      customHeaders:
        Authorization: '******'
      location: westus
      registryName: myRegistry
      resourceGroupName: myResourceGroup
      scope: myRepository
      serviceUri: http://myservice.com
      status: enabled
      tags:
        key: value
      webhookName: myWebhook
Create Webhook Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);@overload
def Webhook(resource_name: str,
            args: WebhookArgs,
            opts: Optional[ResourceOptions] = None)
@overload
def Webhook(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            actions: Optional[Sequence[Union[str, WebhookAction]]] = None,
            registry_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            service_uri: Optional[str] = None,
            custom_headers: Optional[Mapping[str, str]] = None,
            location: Optional[str] = None,
            scope: Optional[str] = None,
            status: Optional[Union[str, WebhookStatus]] = None,
            tags: Optional[Mapping[str, str]] = None,
            webhook_name: Optional[str] = None)func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
public Webhook(String name, WebhookArgs args)
public Webhook(String name, WebhookArgs args, CustomResourceOptions options)
type: azure-native:containerregistry:Webhook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WebhookArgs
- 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 WebhookArgs
- 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 WebhookArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WebhookArgs
- 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 examplewebhookResourceResourceFromContainerregistry = new AzureNative.ContainerRegistry.Webhook("examplewebhookResourceResourceFromContainerregistry", new()
{
    Actions = new[]
    {
        "string",
    },
    RegistryName = "string",
    ResourceGroupName = "string",
    ServiceUri = "string",
    CustomHeaders = 
    {
        { "string", "string" },
    },
    Location = "string",
    Scope = "string",
    Status = "string",
    Tags = 
    {
        { "string", "string" },
    },
    WebhookName = "string",
});
example, err := containerregistry.NewWebhook(ctx, "examplewebhookResourceResourceFromContainerregistry", &containerregistry.WebhookArgs{
	Actions: pulumi.StringArray{
		pulumi.String("string"),
	},
	RegistryName:      pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	ServiceUri:        pulumi.String("string"),
	CustomHeaders: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Location: pulumi.String("string"),
	Scope:    pulumi.String("string"),
	Status:   pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	WebhookName: pulumi.String("string"),
})
var examplewebhookResourceResourceFromContainerregistry = new Webhook("examplewebhookResourceResourceFromContainerregistry", WebhookArgs.builder()
    .actions("string")
    .registryName("string")
    .resourceGroupName("string")
    .serviceUri("string")
    .customHeaders(Map.of("string", "string"))
    .location("string")
    .scope("string")
    .status("string")
    .tags(Map.of("string", "string"))
    .webhookName("string")
    .build());
examplewebhook_resource_resource_from_containerregistry = azure_native.containerregistry.Webhook("examplewebhookResourceResourceFromContainerregistry",
    actions=["string"],
    registry_name="string",
    resource_group_name="string",
    service_uri="string",
    custom_headers={
        "string": "string",
    },
    location="string",
    scope="string",
    status="string",
    tags={
        "string": "string",
    },
    webhook_name="string")
const examplewebhookResourceResourceFromContainerregistry = new azure_native.containerregistry.Webhook("examplewebhookResourceResourceFromContainerregistry", {
    actions: ["string"],
    registryName: "string",
    resourceGroupName: "string",
    serviceUri: "string",
    customHeaders: {
        string: "string",
    },
    location: "string",
    scope: "string",
    status: "string",
    tags: {
        string: "string",
    },
    webhookName: "string",
});
type: azure-native:containerregistry:Webhook
properties:
    actions:
        - string
    customHeaders:
        string: string
    location: string
    registryName: string
    resourceGroupName: string
    scope: string
    serviceUri: string
    status: string
    tags:
        string: string
    webhookName: string
Webhook 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 Webhook resource accepts the following input properties:
- Actions
List<Union<string, Pulumi.Azure Native. Container Registry. Webhook Action>> 
- The list of actions that trigger the webhook to post notifications.
- RegistryName string
- The name of the container registry.
- ResourceGroup stringName 
- The name of the resource group. The name is case insensitive.
- ServiceUri string
- The service URI for the webhook to post notifications.
- CustomHeaders Dictionary<string, string>
- Custom headers that will be added to the webhook notifications.
- Location string
- The location of the webhook. This cannot be changed after the resource is created.
- Scope 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.
- Status
string | Pulumi.Azure Native. Container Registry. Webhook Status 
- The status of the webhook at the time the operation was called.
- Dictionary<string, string>
- The tags for the webhook.
- WebhookName string
- The name of the webhook.
- Actions []string
- The list of actions that trigger the webhook to post notifications.
- RegistryName string
- The name of the container registry.
- ResourceGroup stringName 
- The name of the resource group. The name is case insensitive.
- ServiceUri string
- The service URI for the webhook to post notifications.
- CustomHeaders map[string]string
- Custom headers that will be added to the webhook notifications.
- Location string
- The location of the webhook. This cannot be changed after the resource is created.
- Scope 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.
- Status
string | WebhookStatus 
- The status of the webhook at the time the operation was called.
- map[string]string
- The tags for the webhook.
- WebhookName string
- The name of the webhook.
- actions
List<Either<String,WebhookAction>> 
- The list of actions that trigger the webhook to post notifications.
- registryName String
- The name of the container registry.
- resourceGroup StringName 
- The name of the resource group. The name is case insensitive.
- serviceUri String
- The service URI for the webhook to post notifications.
- customHeaders Map<String,String>
- Custom headers that will be added to the webhook notifications.
- location String
- The location of the webhook. This cannot be changed after the resource is created.
- scope 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.
- status
String | WebhookStatus 
- The status of the webhook at the time the operation was called.
- Map<String,String>
- The tags for the webhook.
- webhookName String
- The name of the webhook.
- actions
(string | WebhookAction)[] 
- The list of actions that trigger the webhook to post notifications.
- registryName string
- The name of the container registry.
- resourceGroup stringName 
- The name of the resource group. The name is case insensitive.
- serviceUri string
- The service URI for the webhook to post notifications.
- customHeaders {[key: string]: string}
- Custom headers that will be added to the webhook notifications.
- location string
- The location of the webhook. This cannot be changed after the resource is created.
- scope 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.
- status
string | WebhookStatus 
- The status of the webhook at the time the operation was called.
- {[key: string]: string}
- The tags for the webhook.
- webhookName string
- The name of the webhook.
- actions
Sequence[Union[str, WebhookAction]] 
- The list of actions that trigger the webhook to post notifications.
- registry_name str
- The name of the container registry.
- resource_group_ strname 
- The name of the resource group. The name is case insensitive.
- service_uri str
- The service URI for the webhook to post notifications.
- custom_headers Mapping[str, str]
- Custom headers that will be added to the webhook notifications.
- location str
- The location of the webhook. This cannot be changed after the resource is created.
- scope str
- 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.
- status
str | WebhookStatus 
- The status of the webhook at the time the operation was called.
- Mapping[str, str]
- The tags for the webhook.
- webhook_name str
- The name of the webhook.
- actions
List<String | "push" | "delete" | "quarantine" | "chart_push" | "chart_ delete"> 
- The list of actions that trigger the webhook to post notifications.
- registryName String
- The name of the container registry.
- resourceGroup StringName 
- The name of the resource group. The name is case insensitive.
- serviceUri String
- The service URI for the webhook to post notifications.
- customHeaders Map<String>
- Custom headers that will be added to the webhook notifications.
- location String
- The location of the webhook. This cannot be changed after the resource is created.
- scope 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.
- status String | "enabled" | "disabled"
- The status of the webhook at the time the operation was called.
- Map<String>
- The tags for the webhook.
- webhookName String
- The name of the webhook.
Outputs
All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource.
- ProvisioningState string
- The provisioning state of the webhook at the time the operation was called.
- SystemData Pulumi.Azure Native. Container Registry. Outputs. System Data Response 
- Metadata pertaining to creation and last modification of the resource.
- Type string
- The type of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource.
- ProvisioningState string
- The provisioning state of the webhook at the time the operation was called.
- SystemData SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- Type string
- The type of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource.
- provisioningState String
- The provisioning state of the webhook at the time the operation was called.
- systemData SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- type String
- The type of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the resource.
- provisioningState string
- The provisioning state of the webhook at the time the operation was called.
- systemData SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- type string
- The type of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the resource.
- provisioning_state str
- The provisioning state of the webhook at the time the operation was called.
- system_data SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- type str
- The type of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource.
- provisioningState String
- The provisioning state of the webhook at the time the operation was called.
- systemData Property Map
- Metadata pertaining to creation and last modification of the resource.
- type String
- The type of the resource.
Supporting Types
SystemDataResponse, SystemDataResponseArgs      
- CreatedAt string
- The timestamp of resource creation (UTC).
- CreatedBy string
- The identity that created the resource.
- CreatedBy stringType 
- The type of identity that created the resource.
- LastModified stringAt 
- The timestamp of resource modification (UTC).
- LastModified stringBy 
- The identity that last modified the resource.
- LastModified stringBy Type 
- The type of identity that last modified the resource.
- CreatedAt string
- The timestamp of resource creation (UTC).
- CreatedBy string
- The identity that created the resource.
- CreatedBy stringType 
- The type of identity that created the resource.
- LastModified stringAt 
- The timestamp of resource modification (UTC).
- LastModified stringBy 
- The identity that last modified the resource.
- LastModified stringBy Type 
- The type of identity that last modified the resource.
- createdAt String
- The timestamp of resource creation (UTC).
- createdBy String
- The identity that created the resource.
- createdBy StringType 
- The type of identity that created the resource.
- lastModified StringAt 
- The timestamp of resource modification (UTC).
- lastModified StringBy 
- The identity that last modified the resource.
- lastModified StringBy Type 
- The type of identity that last modified the resource.
- createdAt string
- The timestamp of resource creation (UTC).
- createdBy string
- The identity that created the resource.
- createdBy stringType 
- The type of identity that created the resource.
- lastModified stringAt 
- The timestamp of resource modification (UTC).
- lastModified stringBy 
- The identity that last modified the resource.
- lastModified stringBy Type 
- The type of identity that last modified the resource.
- created_at str
- The timestamp of resource creation (UTC).
- created_by str
- The identity that created the resource.
- created_by_ strtype 
- The type of identity that created the resource.
- last_modified_ strat 
- The timestamp of resource modification (UTC).
- last_modified_ strby 
- The identity that last modified the resource.
- last_modified_ strby_ type 
- The type of identity that last modified the resource.
- createdAt String
- The timestamp of resource creation (UTC).
- createdBy String
- The identity that created the resource.
- createdBy StringType 
- The type of identity that created the resource.
- lastModified StringAt 
- The timestamp of resource modification (UTC).
- lastModified StringBy 
- The identity that last modified the resource.
- lastModified StringBy Type 
- The type of identity that last modified the resource.
WebhookAction, WebhookActionArgs    
- Push
- push
- Delete
- delete
- Quarantine
- quarantine
- Chart_push 
- chart_push
- Chart_delete 
- chart_delete
- WebhookAction Push 
- push
- WebhookAction Delete 
- delete
- WebhookAction Quarantine 
- quarantine
- WebhookAction_Chart_ push 
- chart_push
- WebhookAction_Chart_ delete 
- chart_delete
- Push
- push
- Delete
- delete
- Quarantine
- quarantine
- Chart_push 
- chart_push
- Chart_delete 
- chart_delete
- Push
- push
- Delete
- delete
- Quarantine
- quarantine
- Chart_push 
- chart_push
- Chart_delete 
- chart_delete
- PUSH
- push
- DELETE
- delete
- QUARANTINE
- quarantine
- CHART_PUSH
- chart_push
- CHART_DELETE
- chart_delete
- "push"
- push
- "delete"
- delete
- "quarantine"
- quarantine
- "chart_push" 
- chart_push
- "chart_delete" 
- chart_delete
WebhookStatus, WebhookStatusArgs    
- Enabled
- enabled
- Disabled
- disabled
- WebhookStatus Enabled 
- enabled
- WebhookStatus Disabled 
- disabled
- Enabled
- enabled
- Disabled
- disabled
- Enabled
- enabled
- Disabled
- disabled
- ENABLED
- enabled
- DISABLED
- disabled
- "enabled"
- enabled
- "disabled"
- disabled
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} 
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0