1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. R2BucketEventNotification
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.R2BucketEventNotification

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleR2BucketEventNotification = new cloudflare.R2BucketEventNotification("example_r2_bucket_event_notification", {
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        bucketName: "example-bucket",
        queueId: "queue_id",
        rules: [{
            actions: [
                "PutObject",
                "CopyObject",
            ],
            description: "Notifications from source bucket to queue",
            prefix: "img/",
            suffix: ".jpeg",
        }],
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_r2_bucket_event_notification = cloudflare.R2BucketEventNotification("example_r2_bucket_event_notification",
        account_id="023e105f4ecef8ad9ca31a8372d0c353",
        bucket_name="example-bucket",
        queue_id="queue_id",
        rules=[{
            "actions": [
                "PutObject",
                "CopyObject",
            ],
            "description": "Notifications from source bucket to queue",
            "prefix": "img/",
            "suffix": ".jpeg",
        }])
    
    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.NewR2BucketEventNotification(ctx, "example_r2_bucket_event_notification", &cloudflare.R2BucketEventNotificationArgs{
    			AccountId:  pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			BucketName: pulumi.String("example-bucket"),
    			QueueId:    pulumi.String("queue_id"),
    			Rules: cloudflare.R2BucketEventNotificationRuleArray{
    				&cloudflare.R2BucketEventNotificationRuleArgs{
    					Actions: pulumi.StringArray{
    						pulumi.String("PutObject"),
    						pulumi.String("CopyObject"),
    					},
    					Description: pulumi.String("Notifications from source bucket to queue"),
    					Prefix:      pulumi.String("img/"),
    					Suffix:      pulumi.String(".jpeg"),
    				},
    			},
    		})
    		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 exampleR2BucketEventNotification = new Cloudflare.R2BucketEventNotification("example_r2_bucket_event_notification", new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            BucketName = "example-bucket",
            QueueId = "queue_id",
            Rules = new[]
            {
                new Cloudflare.Inputs.R2BucketEventNotificationRuleArgs
                {
                    Actions = new[]
                    {
                        "PutObject",
                        "CopyObject",
                    },
                    Description = "Notifications from source bucket to queue",
                    Prefix = "img/",
                    Suffix = ".jpeg",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.R2BucketEventNotification;
    import com.pulumi.cloudflare.R2BucketEventNotificationArgs;
    import com.pulumi.cloudflare.inputs.R2BucketEventNotificationRuleArgs;
    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 exampleR2BucketEventNotification = new R2BucketEventNotification("exampleR2BucketEventNotification", R2BucketEventNotificationArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .bucketName("example-bucket")
                .queueId("queue_id")
                .rules(R2BucketEventNotificationRuleArgs.builder()
                    .actions(                
                        "PutObject",
                        "CopyObject")
                    .description("Notifications from source bucket to queue")
                    .prefix("img/")
                    .suffix(".jpeg")
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleR2BucketEventNotification:
        type: cloudflare:R2BucketEventNotification
        name: example_r2_bucket_event_notification
        properties:
          accountId: 023e105f4ecef8ad9ca31a8372d0c353
          bucketName: example-bucket
          queueId: queue_id
          rules:
            - actions:
                - PutObject
                - CopyObject
              description: Notifications from source bucket to queue
              prefix: img/
              suffix: .jpeg
    

    Create R2BucketEventNotification Resource

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

    Constructor syntax

    new R2BucketEventNotification(name: string, args: R2BucketEventNotificationArgs, opts?: CustomResourceOptions);
    @overload
    def R2BucketEventNotification(resource_name: str,
                                  args: R2BucketEventNotificationArgs,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def R2BucketEventNotification(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  account_id: Optional[str] = None,
                                  bucket_name: Optional[str] = None,
                                  jurisdiction: Optional[str] = None,
                                  queue_id: Optional[str] = None,
                                  rules: Optional[Sequence[R2BucketEventNotificationRuleArgs]] = None)
    func NewR2BucketEventNotification(ctx *Context, name string, args R2BucketEventNotificationArgs, opts ...ResourceOption) (*R2BucketEventNotification, error)
    public R2BucketEventNotification(string name, R2BucketEventNotificationArgs args, CustomResourceOptions? opts = null)
    public R2BucketEventNotification(String name, R2BucketEventNotificationArgs args)
    public R2BucketEventNotification(String name, R2BucketEventNotificationArgs args, CustomResourceOptions options)
    
    type: cloudflare:R2BucketEventNotification
    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 R2BucketEventNotificationArgs
    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 R2BucketEventNotificationArgs
    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 R2BucketEventNotificationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args R2BucketEventNotificationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args R2BucketEventNotificationArgs
    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 r2bucketEventNotificationResource = new Cloudflare.R2BucketEventNotification("r2bucketEventNotificationResource", new()
    {
        AccountId = "string",
        BucketName = "string",
        Jurisdiction = "string",
        QueueId = "string",
        Rules = new[]
        {
            new Cloudflare.Inputs.R2BucketEventNotificationRuleArgs
            {
                Actions = new[]
                {
                    "string",
                },
                Description = "string",
                Prefix = "string",
                Suffix = "string",
            },
        },
    });
    
    example, err := cloudflare.NewR2BucketEventNotification(ctx, "r2bucketEventNotificationResource", &cloudflare.R2BucketEventNotificationArgs{
    	AccountId:    pulumi.String("string"),
    	BucketName:   pulumi.String("string"),
    	Jurisdiction: pulumi.String("string"),
    	QueueId:      pulumi.String("string"),
    	Rules: cloudflare.R2BucketEventNotificationRuleArray{
    		&cloudflare.R2BucketEventNotificationRuleArgs{
    			Actions: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Description: pulumi.String("string"),
    			Prefix:      pulumi.String("string"),
    			Suffix:      pulumi.String("string"),
    		},
    	},
    })
    
    var r2bucketEventNotificationResource = new R2BucketEventNotification("r2bucketEventNotificationResource", R2BucketEventNotificationArgs.builder()
        .accountId("string")
        .bucketName("string")
        .jurisdiction("string")
        .queueId("string")
        .rules(R2BucketEventNotificationRuleArgs.builder()
            .actions("string")
            .description("string")
            .prefix("string")
            .suffix("string")
            .build())
        .build());
    
    r2bucket_event_notification_resource = cloudflare.R2BucketEventNotification("r2bucketEventNotificationResource",
        account_id="string",
        bucket_name="string",
        jurisdiction="string",
        queue_id="string",
        rules=[{
            "actions": ["string"],
            "description": "string",
            "prefix": "string",
            "suffix": "string",
        }])
    
    const r2bucketEventNotificationResource = new cloudflare.R2BucketEventNotification("r2bucketEventNotificationResource", {
        accountId: "string",
        bucketName: "string",
        jurisdiction: "string",
        queueId: "string",
        rules: [{
            actions: ["string"],
            description: "string",
            prefix: "string",
            suffix: "string",
        }],
    });
    
    type: cloudflare:R2BucketEventNotification
    properties:
        accountId: string
        bucketName: string
        jurisdiction: string
        queueId: string
        rules:
            - actions:
                - string
              description: string
              prefix: string
              suffix: string
    

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

    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    Jurisdiction string
    Jurisdiction of the bucket
    QueueId string
    Queue ID
    Rules List<R2BucketEventNotificationRule>
    Array of rules to drive notifications
    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    Jurisdiction string
    Jurisdiction of the bucket
    QueueId string
    Queue ID
    Rules []R2BucketEventNotificationRuleArgs
    Array of rules to drive notifications
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    jurisdiction String
    Jurisdiction of the bucket
    queueId String
    Queue ID
    rules List<R2BucketEventNotificationRule>
    Array of rules to drive notifications
    accountId string
    Account ID
    bucketName string
    Name of the bucket
    jurisdiction string
    Jurisdiction of the bucket
    queueId string
    Queue ID
    rules R2BucketEventNotificationRule[]
    Array of rules to drive notifications
    account_id str
    Account ID
    bucket_name str
    Name of the bucket
    jurisdiction str
    Jurisdiction of the bucket
    queue_id str
    Queue ID
    rules Sequence[R2BucketEventNotificationRuleArgs]
    Array of rules to drive notifications
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    jurisdiction String
    Jurisdiction of the bucket
    queueId String
    Queue ID
    rules List<Property Map>
    Array of rules to drive notifications

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Queues List<R2BucketEventNotificationQueue>
    List of queues associated with the bucket.
    Id string
    The provider-assigned unique ID for this managed resource.
    Queues []R2BucketEventNotificationQueue
    List of queues associated with the bucket.
    id String
    The provider-assigned unique ID for this managed resource.
    queues List<R2BucketEventNotificationQueue>
    List of queues associated with the bucket.
    id string
    The provider-assigned unique ID for this managed resource.
    queues R2BucketEventNotificationQueue[]
    List of queues associated with the bucket.
    id str
    The provider-assigned unique ID for this managed resource.
    queues Sequence[R2BucketEventNotificationQueue]
    List of queues associated with the bucket.
    id String
    The provider-assigned unique ID for this managed resource.
    queues List<Property Map>
    List of queues associated with the bucket.

    Look up Existing R2BucketEventNotification Resource

    Get an existing R2BucketEventNotification 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?: R2BucketEventNotificationState, opts?: CustomResourceOptions): R2BucketEventNotification
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            bucket_name: Optional[str] = None,
            jurisdiction: Optional[str] = None,
            queue_id: Optional[str] = None,
            queues: Optional[Sequence[R2BucketEventNotificationQueueArgs]] = None,
            rules: Optional[Sequence[R2BucketEventNotificationRuleArgs]] = None) -> R2BucketEventNotification
    func GetR2BucketEventNotification(ctx *Context, name string, id IDInput, state *R2BucketEventNotificationState, opts ...ResourceOption) (*R2BucketEventNotification, error)
    public static R2BucketEventNotification Get(string name, Input<string> id, R2BucketEventNotificationState? state, CustomResourceOptions? opts = null)
    public static R2BucketEventNotification get(String name, Output<String> id, R2BucketEventNotificationState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:R2BucketEventNotification    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
    Account ID
    BucketName string
    Name of the bucket
    Jurisdiction string
    Jurisdiction of the bucket
    QueueId string
    Queue ID
    Queues List<R2BucketEventNotificationQueue>
    List of queues associated with the bucket.
    Rules List<R2BucketEventNotificationRule>
    Array of rules to drive notifications
    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    Jurisdiction string
    Jurisdiction of the bucket
    QueueId string
    Queue ID
    Queues []R2BucketEventNotificationQueueArgs
    List of queues associated with the bucket.
    Rules []R2BucketEventNotificationRuleArgs
    Array of rules to drive notifications
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    jurisdiction String
    Jurisdiction of the bucket
    queueId String
    Queue ID
    queues List<R2BucketEventNotificationQueue>
    List of queues associated with the bucket.
    rules List<R2BucketEventNotificationRule>
    Array of rules to drive notifications
    accountId string
    Account ID
    bucketName string
    Name of the bucket
    jurisdiction string
    Jurisdiction of the bucket
    queueId string
    Queue ID
    queues R2BucketEventNotificationQueue[]
    List of queues associated with the bucket.
    rules R2BucketEventNotificationRule[]
    Array of rules to drive notifications
    account_id str
    Account ID
    bucket_name str
    Name of the bucket
    jurisdiction str
    Jurisdiction of the bucket
    queue_id str
    Queue ID
    queues Sequence[R2BucketEventNotificationQueueArgs]
    List of queues associated with the bucket.
    rules Sequence[R2BucketEventNotificationRuleArgs]
    Array of rules to drive notifications
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    jurisdiction String
    Jurisdiction of the bucket
    queueId String
    Queue ID
    queues List<Property Map>
    List of queues associated with the bucket.
    rules List<Property Map>
    Array of rules to drive notifications

    Supporting Types

    R2BucketEventNotificationQueue, R2BucketEventNotificationQueueArgs

    QueueId string
    Queue ID
    QueueName string
    Name of the queue
    Rules []R2BucketEventNotificationQueueRule
    queueId string
    Queue ID
    queueName string
    Name of the queue
    rules R2BucketEventNotificationQueueRule[]
    queueId String
    Queue ID
    queueName String
    Name of the queue
    rules List<Property Map>

    R2BucketEventNotificationQueueRule, R2BucketEventNotificationQueueRuleArgs

    Actions List<string>
    Array of R2 object actions that will trigger notifications
    CreatedAt string
    Timestamp when the rule was created
    Description string
    A description that can be used to identify the event notification rule after creation
    Prefix string
    Notifications will be sent only for objects with this prefix
    RuleId string
    Rule ID
    Suffix string
    Notifications will be sent only for objects with this suffix
    Actions []string
    Array of R2 object actions that will trigger notifications
    CreatedAt string
    Timestamp when the rule was created
    Description string
    A description that can be used to identify the event notification rule after creation
    Prefix string
    Notifications will be sent only for objects with this prefix
    RuleId string
    Rule ID
    Suffix string
    Notifications will be sent only for objects with this suffix
    actions List<String>
    Array of R2 object actions that will trigger notifications
    createdAt String
    Timestamp when the rule was created
    description String
    A description that can be used to identify the event notification rule after creation
    prefix String
    Notifications will be sent only for objects with this prefix
    ruleId String
    Rule ID
    suffix String
    Notifications will be sent only for objects with this suffix
    actions string[]
    Array of R2 object actions that will trigger notifications
    createdAt string
    Timestamp when the rule was created
    description string
    A description that can be used to identify the event notification rule after creation
    prefix string
    Notifications will be sent only for objects with this prefix
    ruleId string
    Rule ID
    suffix string
    Notifications will be sent only for objects with this suffix
    actions Sequence[str]
    Array of R2 object actions that will trigger notifications
    created_at str
    Timestamp when the rule was created
    description str
    A description that can be used to identify the event notification rule after creation
    prefix str
    Notifications will be sent only for objects with this prefix
    rule_id str
    Rule ID
    suffix str
    Notifications will be sent only for objects with this suffix
    actions List<String>
    Array of R2 object actions that will trigger notifications
    createdAt String
    Timestamp when the rule was created
    description String
    A description that can be used to identify the event notification rule after creation
    prefix String
    Notifications will be sent only for objects with this prefix
    ruleId String
    Rule ID
    suffix String
    Notifications will be sent only for objects with this suffix

    R2BucketEventNotificationRule, R2BucketEventNotificationRuleArgs

    Actions List<string>
    Array of R2 object actions that will trigger notifications
    Description string
    A description that can be used to identify the event notification rule after creation
    Prefix string
    Notifications will be sent only for objects with this prefix
    Suffix string
    Notifications will be sent only for objects with this suffix
    Actions []string
    Array of R2 object actions that will trigger notifications
    Description string
    A description that can be used to identify the event notification rule after creation
    Prefix string
    Notifications will be sent only for objects with this prefix
    Suffix string
    Notifications will be sent only for objects with this suffix
    actions List<String>
    Array of R2 object actions that will trigger notifications
    description String
    A description that can be used to identify the event notification rule after creation
    prefix String
    Notifications will be sent only for objects with this prefix
    suffix String
    Notifications will be sent only for objects with this suffix
    actions string[]
    Array of R2 object actions that will trigger notifications
    description string
    A description that can be used to identify the event notification rule after creation
    prefix string
    Notifications will be sent only for objects with this prefix
    suffix string
    Notifications will be sent only for objects with this suffix
    actions Sequence[str]
    Array of R2 object actions that will trigger notifications
    description str
    A description that can be used to identify the event notification rule after creation
    prefix str
    Notifications will be sent only for objects with this prefix
    suffix str
    Notifications will be sent only for objects with this suffix
    actions List<String>
    Array of R2 object actions that will trigger notifications
    description String
    A description that can be used to identify the event notification rule after creation
    prefix String
    Notifications will be sent only for objects with this prefix
    suffix String
    Notifications will be sent only for objects with this suffix

    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.2 published on Monday, Apr 28, 2025 by Pulumi