1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. NotificationPolicyWebhooks
Cloudflare v6.1.1 published on Monday, Apr 21, 2025 by Pulumi

cloudflare.NotificationPolicyWebhooks

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.1 published on Monday, Apr 21, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleNotificationPolicyWebhooks = new cloudflare.NotificationPolicyWebhooks("example_notification_policy_webhooks", {
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        name: "Slack Webhook",
        url: "https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
        secret: "secret",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_notification_policy_webhooks = cloudflare.NotificationPolicyWebhooks("example_notification_policy_webhooks",
        account_id="023e105f4ecef8ad9ca31a8372d0c353",
        name="Slack Webhook",
        url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
        secret="secret")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.NewNotificationPolicyWebhooks(ctx, "example_notification_policy_webhooks", &cloudflare.NotificationPolicyWebhooksArgs{
    			AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			Name:      pulumi.String("Slack Webhook"),
    			Url:       pulumi.String("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"),
    			Secret:    pulumi.String("secret"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleNotificationPolicyWebhooks = new Cloudflare.NotificationPolicyWebhooks("example_notification_policy_webhooks", new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            Name = "Slack Webhook",
            Url = "https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
            Secret = "secret",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.NotificationPolicyWebhooks;
    import com.pulumi.cloudflare.NotificationPolicyWebhooksArgs;
    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 exampleNotificationPolicyWebhooks = new NotificationPolicyWebhooks("exampleNotificationPolicyWebhooks", NotificationPolicyWebhooksArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .name("Slack Webhook")
                .url("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd")
                .secret("secret")
                .build());
    
        }
    }
    
    resources:
      exampleNotificationPolicyWebhooks:
        type: cloudflare:NotificationPolicyWebhooks
        name: example_notification_policy_webhooks
        properties:
          accountId: 023e105f4ecef8ad9ca31a8372d0c353
          name: Slack Webhook
          url: https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd
          secret: secret
    

    Create NotificationPolicyWebhooks Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NotificationPolicyWebhooks(name: string, args: NotificationPolicyWebhooksArgs, opts?: CustomResourceOptions);
    @overload
    def NotificationPolicyWebhooks(resource_name: str,
                                   args: NotificationPolicyWebhooksArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def NotificationPolicyWebhooks(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   account_id: Optional[str] = None,
                                   name: Optional[str] = None,
                                   url: Optional[str] = None,
                                   secret: Optional[str] = None)
    func NewNotificationPolicyWebhooks(ctx *Context, name string, args NotificationPolicyWebhooksArgs, opts ...ResourceOption) (*NotificationPolicyWebhooks, error)
    public NotificationPolicyWebhooks(string name, NotificationPolicyWebhooksArgs args, CustomResourceOptions? opts = null)
    public NotificationPolicyWebhooks(String name, NotificationPolicyWebhooksArgs args)
    public NotificationPolicyWebhooks(String name, NotificationPolicyWebhooksArgs args, CustomResourceOptions options)
    
    type: cloudflare:NotificationPolicyWebhooks
    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 NotificationPolicyWebhooksArgs
    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 NotificationPolicyWebhooksArgs
    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 NotificationPolicyWebhooksArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NotificationPolicyWebhooksArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NotificationPolicyWebhooksArgs
    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 notificationPolicyWebhooksResource = new Cloudflare.NotificationPolicyWebhooks("notificationPolicyWebhooksResource", new()
    {
        AccountId = "string",
        Name = "string",
        Url = "string",
        Secret = "string",
    });
    
    example, err := cloudflare.NewNotificationPolicyWebhooks(ctx, "notificationPolicyWebhooksResource", &cloudflare.NotificationPolicyWebhooksArgs{
    	AccountId: pulumi.String("string"),
    	Name:      pulumi.String("string"),
    	Url:       pulumi.String("string"),
    	Secret:    pulumi.String("string"),
    })
    
    var notificationPolicyWebhooksResource = new NotificationPolicyWebhooks("notificationPolicyWebhooksResource", NotificationPolicyWebhooksArgs.builder()
        .accountId("string")
        .name("string")
        .url("string")
        .secret("string")
        .build());
    
    notification_policy_webhooks_resource = cloudflare.NotificationPolicyWebhooks("notificationPolicyWebhooksResource",
        account_id="string",
        name="string",
        url="string",
        secret="string")
    
    const notificationPolicyWebhooksResource = new cloudflare.NotificationPolicyWebhooks("notificationPolicyWebhooksResource", {
        accountId: "string",
        name: "string",
        url: "string",
        secret: "string",
    });
    
    type: cloudflare:NotificationPolicyWebhooks
    properties:
        accountId: string
        name: string
        secret: string
        url: string
    

    NotificationPolicyWebhooks 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 NotificationPolicyWebhooks resource accepts the following input properties:

    AccountId string
    The account id
    Name string
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    Url string
    The POST endpoint to call when dispatching a notification.
    Secret string
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    AccountId string
    The account id
    Name string
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    Url string
    The POST endpoint to call when dispatching a notification.
    Secret string
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    accountId String
    The account id
    name String
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    url String
    The POST endpoint to call when dispatching a notification.
    secret String
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    accountId string
    The account id
    name string
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    url string
    The POST endpoint to call when dispatching a notification.
    secret string
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    account_id str
    The account id
    name str
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    url str
    The POST endpoint to call when dispatching a notification.
    secret str
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    accountId String
    The account id
    name String
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    url String
    The POST endpoint to call when dispatching a notification.
    secret String
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NotificationPolicyWebhooks resource produces the following output properties:

    CreatedAt string
    Timestamp of when the webhook destination was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastFailure string
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    LastSuccess string
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    Type string
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    CreatedAt string
    Timestamp of when the webhook destination was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastFailure string
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    LastSuccess string
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    Type string
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    createdAt String
    Timestamp of when the webhook destination was created.
    id String
    The provider-assigned unique ID for this managed resource.
    lastFailure String
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    lastSuccess String
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    type String
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    createdAt string
    Timestamp of when the webhook destination was created.
    id string
    The provider-assigned unique ID for this managed resource.
    lastFailure string
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    lastSuccess string
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    type string
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    created_at str
    Timestamp of when the webhook destination was created.
    id str
    The provider-assigned unique ID for this managed resource.
    last_failure str
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    last_success str
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    type str
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    createdAt String
    Timestamp of when the webhook destination was created.
    id String
    The provider-assigned unique ID for this managed resource.
    lastFailure String
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    lastSuccess String
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    type String
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".

    Look up Existing NotificationPolicyWebhooks Resource

    Get an existing NotificationPolicyWebhooks resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NotificationPolicyWebhooksState, opts?: CustomResourceOptions): NotificationPolicyWebhooks
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            created_at: Optional[str] = None,
            last_failure: Optional[str] = None,
            last_success: Optional[str] = None,
            name: Optional[str] = None,
            secret: Optional[str] = None,
            type: Optional[str] = None,
            url: Optional[str] = None) -> NotificationPolicyWebhooks
    func GetNotificationPolicyWebhooks(ctx *Context, name string, id IDInput, state *NotificationPolicyWebhooksState, opts ...ResourceOption) (*NotificationPolicyWebhooks, error)
    public static NotificationPolicyWebhooks Get(string name, Input<string> id, NotificationPolicyWebhooksState? state, CustomResourceOptions? opts = null)
    public static NotificationPolicyWebhooks get(String name, Output<String> id, NotificationPolicyWebhooksState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:NotificationPolicyWebhooks    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountId string
    The account id
    CreatedAt string
    Timestamp of when the webhook destination was created.
    LastFailure string
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    LastSuccess string
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    Name string
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    Secret string
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    Type string
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    Url string
    The POST endpoint to call when dispatching a notification.
    AccountId string
    The account id
    CreatedAt string
    Timestamp of when the webhook destination was created.
    LastFailure string
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    LastSuccess string
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    Name string
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    Secret string
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    Type string
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    Url string
    The POST endpoint to call when dispatching a notification.
    accountId String
    The account id
    createdAt String
    Timestamp of when the webhook destination was created.
    lastFailure String
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    lastSuccess String
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    name String
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    secret String
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    type String
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    url String
    The POST endpoint to call when dispatching a notification.
    accountId string
    The account id
    createdAt string
    Timestamp of when the webhook destination was created.
    lastFailure string
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    lastSuccess string
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    name string
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    secret string
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    type string
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    url string
    The POST endpoint to call when dispatching a notification.
    account_id str
    The account id
    created_at str
    Timestamp of when the webhook destination was created.
    last_failure str
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    last_success str
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    name str
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    secret str
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    type str
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    url str
    The POST endpoint to call when dispatching a notification.
    accountId String
    The account id
    createdAt String
    Timestamp of when the webhook destination was created.
    lastFailure String
    Timestamp of the last time an attempt to dispatch a notification to this webhook failed.
    lastSuccess String
    Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.
    name String
    The name of the webhook destination. This will be included in the request body when you receive a webhook notification.
    secret String
    Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.
    type String
    Type of webhook endpoint. Available values: "slack", "generic", "gchat".
    url String
    The POST endpoint to call when dispatching a notification.

    Import

    $ pulumi import cloudflare:index/notificationPolicyWebhooks:NotificationPolicyWebhooks example '<account_id>/<webhook_id>'
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.1 published on Monday, Apr 21, 2025 by Pulumi