1. Packages
  2. Azure Native
  3. API Docs
  4. containerregistry
  5. Webhook
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

azure-native.containerregistry.Webhook

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

    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.

    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 (
    	"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 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")
    
    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",
    });
    
    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.

    Example

    The following reference example uses placeholder values for all input properties.

    var azure_nativeWebhookResource = new AzureNative.ContainerRegistry.Webhook("azure-nativeWebhookResource", 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, "azure-nativeWebhookResource", &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 azure_nativeWebhookResource = new Webhook("azure-nativeWebhookResource", 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());
    
    azure_native_webhook_resource = azure_native.containerregistry.Webhook("azure-nativeWebhookResource",
        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 azure_nativeWebhookResource = new azure_native.containerregistry.Webhook("azure-nativeWebhookResource", {
        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

    The Webhook resource accepts the following input properties:

    Actions List<Union<string, Pulumi.AzureNative.ContainerRegistry.WebhookAction>>
    The list of actions that trigger the webhook to post notifications.
    RegistryName string
    The name of the container registry.
    ResourceGroupName string
    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.AzureNative.ContainerRegistry.WebhookStatus
    The status of the webhook at the time the operation was called.
    Tags 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.
    ResourceGroupName string
    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.
    Tags 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.
    resourceGroupName String
    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.
    tags 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.
    resourceGroupName string
    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.
    tags {[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_name str
    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.
    tags 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.
    resourceGroupName String
    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.
    tags 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.AzureNative.ContainerRegistry.Outputs.SystemDataResponse
    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 SystemDataResponse
    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 SystemDataResponse
    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 SystemDataResponse
    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 SystemDataResponse
    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.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource modification (UTC).
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    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.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource modification (UTC).
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    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.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource modification (UTC).
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    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.
    createdByType string
    The type of identity that created the resource.
    lastModifiedAt string
    The timestamp of resource modification (UTC).
    lastModifiedBy string
    The identity that last modified the resource.
    lastModifiedByType string
    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_type str
    The type of identity that created the resource.
    last_modified_at str
    The timestamp of resource modification (UTC).
    last_modified_by str
    The identity that last modified the resource.
    last_modified_by_type str
    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.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource modification (UTC).
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    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
    WebhookActionPush
    push
    WebhookActionDelete
    delete
    WebhookActionQuarantine
    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
    WebhookStatusEnabled
    enabled
    WebhookStatusDisabled
    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
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi