azure-native.containerregistry.Webhook
Explore with Pulumi AI
An object that represents a webhook for a container registry. API Version: 2019-05-01.
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[]
{
"push",
},
CustomHeaders =
{
{ "Authorization", "******" },
},
Location = "westus",
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
Scope = "myRepository",
ServiceUri = "http://myservice.com",
Status = "enabled",
Tags =
{
{ "key", "value" },
},
WebhookName = "myWebhook",
});
});
package main
import (
containerregistry "github.com/pulumi/pulumi-azure-native-sdk/containerregistry"
"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("push"),
},
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("enabled"),
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=["push"],
custom_headers={
"Authorization": "******",
},
location="westus",
registry_name="myRegistry",
resource_group_name="myResourceGroup",
scope="myRepository",
service_uri="http://myservice.com",
status="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: ["push"],
customHeaders: {
Authorization: "******",
},
location: "westus",
registryName: "myRegistry",
resourceGroupName: "myResourceGroup",
scope: "myRepository",
serviceUri: "http://myservice.com",
status: "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.
Constructor 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: []string{
"string",
},
RegistryName: "string",
ResourceGroupName: "string",
ServiceUri: "string",
CustomHeaders: map[string]interface{}{
"string": "string",
},
Location: "string",
Scope: "string",
Status: "string",
Tags: map[string]interface{}{
"string": "string",
},
WebhookName: "string",
})
var azure_nativeWebhookResource = new Webhook("azure-nativeWebhookResource", WebhookArgs.builder()
.actions("string")
.registryName("string")
.resourceGroupName("string")
.serviceUri("string")
.customHeaders(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.location("string")
.scope("string")
.status("string")
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.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.
Azure Native. Container Registry. Webhook Action>> - The list of actions that trigger the webhook to post notifications.
- Registry
Name string - The name of the container registry.
- Resource
Group stringName - The name of the resource group to which the container registry belongs.
- Service
Uri string - The service URI for the webhook to post notifications.
- Custom
Headers 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.
- Webhook
Name string - The name of the webhook.
- Actions []string
- The list of actions that trigger the webhook to post notifications.
- Registry
Name string - The name of the container registry.
- Resource
Group stringName - The name of the resource group to which the container registry belongs.
- Service
Uri string - The service URI for the webhook to post notifications.
- Custom
Headers 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 | Webhook
Status - The status of the webhook at the time the operation was called.
- map[string]string
- The tags for the webhook.
- Webhook
Name string - The name of the webhook.
- actions
List<Either<String,Webhook
Action>> - The list of actions that trigger the webhook to post notifications.
- registry
Name String - The name of the container registry.
- resource
Group StringName - The name of the resource group to which the container registry belongs.
- service
Uri String - The service URI for the webhook to post notifications.
- custom
Headers 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 | Webhook
Status - The status of the webhook at the time the operation was called.
- Map<String,String>
- The tags for the webhook.
- webhook
Name String - The name of the webhook.
- actions
(string | Webhook
Action)[] - The list of actions that trigger the webhook to post notifications.
- registry
Name string - The name of the container registry.
- resource
Group stringName - The name of the resource group to which the container registry belongs.
- service
Uri string - The service URI for the webhook to post notifications.
- custom
Headers {[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 | Webhook
Status - The status of the webhook at the time the operation was called.
- {[key: string]: string}
- The tags for the webhook.
- webhook
Name string - The name of the webhook.
- actions
Sequence[Union[str, Webhook
Action]] - 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 to which the container registry belongs.
- 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 | Webhook
Status - 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.
- registry
Name String - The name of the container registry.
- resource
Group StringName - The name of the resource group to which the container registry belongs.
- service
Uri String - The service URI for the webhook to post notifications.
- custom
Headers 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.
- webhook
Name 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.
- Provisioning
State string - The provisioning state of the webhook at the time the operation was called.
- 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.
- Provisioning
State string - The provisioning state of the webhook at the time the operation was called.
- 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.
- provisioning
State String - The provisioning state of the webhook at the time the operation was called.
- 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.
- provisioning
State string - The provisioning state of the webhook at the time the operation was called.
- 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.
- 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.
- provisioning
State String - The provisioning state of the webhook at the time the operation was called.
- type String
- The type of the resource.
Supporting Types
WebhookAction, WebhookActionArgs
- Push
- push
- Delete
- delete
- Quarantine
- quarantine
- Chart_
push - chart_push
- Chart_
delete - chart_delete
- Webhook
Action Push - push
- Webhook
Action Delete - delete
- Webhook
Action Quarantine - quarantine
- Webhook
Action_Chart_ push - chart_push
- Webhook
Action_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
- Webhook
Status Enabled - enabled
- Webhook
Status 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/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0