1. Packages
  2. Cloudflare
  3. API Docs
  4. NotificationPolicyWebhooks
Cloudflare v5.34.0 published on Friday, Jul 12, 2024 by Pulumi

cloudflare.NotificationPolicyWebhooks

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.34.0 published on Friday, Jul 12, 2024 by Pulumi

    Provides a resource, that manages a webhook destination. These destinations can be tied to the notification policies created for Cloudflare’s products.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = new cloudflare.NotificationPolicyWebhooks("example", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        name: "Webhooks destination",
        url: "https://example.com",
        secret: "my-secret",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.NotificationPolicyWebhooks("example",
        account_id="f037e56e89293a057740de681ac9abbe",
        name="Webhooks destination",
        url="https://example.com",
        secret="my-secret")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.NewNotificationPolicyWebhooks(ctx, "example", &cloudflare.NotificationPolicyWebhooksArgs{
    			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			Name:      pulumi.String("Webhooks destination"),
    			Url:       pulumi.String("https://example.com"),
    			Secret:    pulumi.String("my-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 example = new Cloudflare.NotificationPolicyWebhooks("example", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            Name = "Webhooks destination",
            Url = "https://example.com",
            Secret = "my-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 example = new NotificationPolicyWebhooks("example", NotificationPolicyWebhooksArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .name("Webhooks destination")
                .url("https://example.com")
                .secret("my-secret")
                .build());
    
        }
    }
    
    resources:
      example:
        type: cloudflare:NotificationPolicyWebhooks
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          name: Webhooks destination
          url: https://example.com
          secret: my-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,
                                   secret: Optional[str] = None,
                                   url: 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",
        Secret = "string",
        Url = "string",
    });
    
    example, err := cloudflare.NewNotificationPolicyWebhooks(ctx, "notificationPolicyWebhooksResource", &cloudflare.NotificationPolicyWebhooksArgs{
    	AccountId: pulumi.String("string"),
    	Name:      pulumi.String("string"),
    	Secret:    pulumi.String("string"),
    	Url:       pulumi.String("string"),
    })
    
    var notificationPolicyWebhooksResource = new NotificationPolicyWebhooks("notificationPolicyWebhooksResource", NotificationPolicyWebhooksArgs.builder()
        .accountId("string")
        .name("string")
        .secret("string")
        .url("string")
        .build());
    
    notification_policy_webhooks_resource = cloudflare.NotificationPolicyWebhooks("notificationPolicyWebhooksResource",
        account_id="string",
        name="string",
        secret="string",
        url="string")
    
    const notificationPolicyWebhooksResource = new cloudflare.NotificationPolicyWebhooks("notificationPolicyWebhooksResource", {
        accountId: "string",
        name: "string",
        secret: "string",
        url: "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

    The NotificationPolicyWebhooks resource accepts the following input properties:

    AccountId string
    The account identifier to target for the resource.
    Name string
    The name of the webhook destination.
    Secret string
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    Url string
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    AccountId string
    The account identifier to target for the resource.
    Name string
    The name of the webhook destination.
    Secret string
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    Url string
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource.
    name String
    The name of the webhook destination.
    secret String
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    url String
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    accountId string
    The account identifier to target for the resource.
    name string
    The name of the webhook destination.
    secret string
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    url string
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    account_id str
    The account identifier to target for the resource.
    name str
    The name of the webhook destination.
    secret str
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    url str
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource.
    name String
    The name of the webhook destination.
    secret String
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    url String
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.

    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 notification webhook was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastFailure string
    Timestamp of when the notification webhook last faiuled.
    LastSuccess string
    Timestamp of when the notification webhook was last successful.
    Type string
    CreatedAt string
    Timestamp of when the notification webhook was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastFailure string
    Timestamp of when the notification webhook last faiuled.
    LastSuccess string
    Timestamp of when the notification webhook was last successful.
    Type string
    createdAt String
    Timestamp of when the notification webhook was created.
    id String
    The provider-assigned unique ID for this managed resource.
    lastFailure String
    Timestamp of when the notification webhook last faiuled.
    lastSuccess String
    Timestamp of when the notification webhook was last successful.
    type String
    createdAt string
    Timestamp of when the notification webhook was created.
    id string
    The provider-assigned unique ID for this managed resource.
    lastFailure string
    Timestamp of when the notification webhook last faiuled.
    lastSuccess string
    Timestamp of when the notification webhook was last successful.
    type string
    created_at str
    Timestamp of when the notification webhook was created.
    id str
    The provider-assigned unique ID for this managed resource.
    last_failure str
    Timestamp of when the notification webhook last faiuled.
    last_success str
    Timestamp of when the notification webhook was last successful.
    type str
    createdAt String
    Timestamp of when the notification webhook was created.
    id String
    The provider-assigned unique ID for this managed resource.
    lastFailure String
    Timestamp of when the notification webhook last faiuled.
    lastSuccess String
    Timestamp of when the notification webhook was last successful.
    type String

    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)
    Resource lookup is not supported in YAML
    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 identifier to target for the resource.
    CreatedAt string
    Timestamp of when the notification webhook was created.
    LastFailure string
    Timestamp of when the notification webhook last faiuled.
    LastSuccess string
    Timestamp of when the notification webhook was last successful.
    Name string
    The name of the webhook destination.
    Secret string
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    Type string
    Url string
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    AccountId string
    The account identifier to target for the resource.
    CreatedAt string
    Timestamp of when the notification webhook was created.
    LastFailure string
    Timestamp of when the notification webhook last faiuled.
    LastSuccess string
    Timestamp of when the notification webhook was last successful.
    Name string
    The name of the webhook destination.
    Secret string
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    Type string
    Url string
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource.
    createdAt String
    Timestamp of when the notification webhook was created.
    lastFailure String
    Timestamp of when the notification webhook last faiuled.
    lastSuccess String
    Timestamp of when the notification webhook was last successful.
    name String
    The name of the webhook destination.
    secret String
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    type String
    url String
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    accountId string
    The account identifier to target for the resource.
    createdAt string
    Timestamp of when the notification webhook was created.
    lastFailure string
    Timestamp of when the notification webhook last faiuled.
    lastSuccess string
    Timestamp of when the notification webhook was last successful.
    name string
    The name of the webhook destination.
    secret string
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    type string
    url string
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    account_id str
    The account identifier to target for the resource.
    created_at str
    Timestamp of when the notification webhook was created.
    last_failure str
    Timestamp of when the notification webhook last faiuled.
    last_success str
    Timestamp of when the notification webhook was last successful.
    name str
    The name of the webhook destination.
    secret str
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    type str
    url str
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource.
    createdAt String
    Timestamp of when the notification webhook was created.
    lastFailure String
    Timestamp of when the notification webhook last faiuled.
    lastSuccess String
    Timestamp of when the notification webhook was last successful.
    name String
    The name of the webhook destination.
    secret String
    An optional secret can be provided that will be passed in the cf-webhook-auth header when dispatching a webhook notification. Secrets are not returned in any API response body. Refer to the documentation for more details.
    type String
    url String
    The URL of the webhook destinations. Modifying this attribute will force creation of a new resource.

    Import

    $ pulumi import cloudflare:index/notificationPolicyWebhooks:NotificationPolicyWebhooks example <account_id>/<notification_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 v5.34.0 published on Friday, Jul 12, 2024 by Pulumi