1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. ObsBucketNotifications
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.ObsBucketNotifications

Explore with Pulumi AI

flexibleengine logo
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

    Manages an OBS bucket Notification Configuration resource within FlexibleEngine.

    The resource overwrites an existing configuration.

    Notification Configuration OBS leverages SMN to provide the event notification function. In OBS, you can use SMN to send event notifications to specified subscribers, so that you will be informed of any critical operations (such as upload and deletion) that occur on specified buckets in real time.

    Example Usage

    OBS Notification Configuration

    import * as pulumi from "@pulumi/pulumi";
    import * as flexibleengine from "@pulumi/flexibleengine";
    
    const bucket = new flexibleengine.ObsBucket("bucket", {
        bucket: "my-test-bucket",
        acl: "public-read",
    });
    const notification = new flexibleengine.ObsBucketNotifications("notification", {
        bucket: bucket.bucket,
        notifications: [{
            name: "notification_name",
            events: ["ObjectCreated:*"],
            prefix: "tf",
            suffix: ".jpg",
            topicUrn: "urn:smn:eu-west-0:d8cb0fdcf29b4badb9ed8b2525a3286f:topic",
        }],
    });
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    bucket = flexibleengine.ObsBucket("bucket",
        bucket="my-test-bucket",
        acl="public-read")
    notification = flexibleengine.ObsBucketNotifications("notification",
        bucket=bucket.bucket,
        notifications=[{
            "name": "notification_name",
            "events": ["ObjectCreated:*"],
            "prefix": "tf",
            "suffix": ".jpg",
            "topic_urn": "urn:smn:eu-west-0:d8cb0fdcf29b4badb9ed8b2525a3286f:topic",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		bucket, err := flexibleengine.NewObsBucket(ctx, "bucket", &flexibleengine.ObsBucketArgs{
    			Bucket: pulumi.String("my-test-bucket"),
    			Acl:    pulumi.String("public-read"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = flexibleengine.NewObsBucketNotifications(ctx, "notification", &flexibleengine.ObsBucketNotificationsArgs{
    			Bucket: bucket.Bucket,
    			Notifications: flexibleengine.ObsBucketNotificationsNotificationArray{
    				&flexibleengine.ObsBucketNotificationsNotificationArgs{
    					Name: pulumi.String("notification_name"),
    					Events: pulumi.StringArray{
    						pulumi.String("ObjectCreated:*"),
    					},
    					Prefix:   pulumi.String("tf"),
    					Suffix:   pulumi.String(".jpg"),
    					TopicUrn: pulumi.String("urn:smn:eu-west-0:d8cb0fdcf29b4badb9ed8b2525a3286f:topic"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Flexibleengine = Pulumi.Flexibleengine;
    
    return await Deployment.RunAsync(() => 
    {
        var bucket = new Flexibleengine.ObsBucket("bucket", new()
        {
            Bucket = "my-test-bucket",
            Acl = "public-read",
        });
    
        var notification = new Flexibleengine.ObsBucketNotifications("notification", new()
        {
            Bucket = bucket.Bucket,
            Notifications = new[]
            {
                new Flexibleengine.Inputs.ObsBucketNotificationsNotificationArgs
                {
                    Name = "notification_name",
                    Events = new[]
                    {
                        "ObjectCreated:*",
                    },
                    Prefix = "tf",
                    Suffix = ".jpg",
                    TopicUrn = "urn:smn:eu-west-0:d8cb0fdcf29b4badb9ed8b2525a3286f:topic",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.flexibleengine.ObsBucket;
    import com.pulumi.flexibleengine.ObsBucketArgs;
    import com.pulumi.flexibleengine.ObsBucketNotifications;
    import com.pulumi.flexibleengine.ObsBucketNotificationsArgs;
    import com.pulumi.flexibleengine.inputs.ObsBucketNotificationsNotificationArgs;
    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 bucket = new ObsBucket("bucket", ObsBucketArgs.builder()
                .bucket("my-test-bucket")
                .acl("public-read")
                .build());
    
            var notification = new ObsBucketNotifications("notification", ObsBucketNotificationsArgs.builder()
                .bucket(bucket.bucket())
                .notifications(ObsBucketNotificationsNotificationArgs.builder()
                    .name("notification_name")
                    .events("ObjectCreated:*")
                    .prefix("tf")
                    .suffix(".jpg")
                    .topicUrn("urn:smn:eu-west-0:d8cb0fdcf29b4badb9ed8b2525a3286f:topic")
                    .build())
                .build());
    
        }
    }
    
    resources:
      bucket:
        type: flexibleengine:ObsBucket
        properties:
          bucket: my-test-bucket
          acl: public-read
      notification:
        type: flexibleengine:ObsBucketNotifications
        properties:
          bucket: ${bucket.bucket}
          notifications:
            - name: notification_name
              events:
                - ObjectCreated:*
              prefix: tf
              suffix: .jpg
              topicUrn: urn:smn:eu-west-0:d8cb0fdcf29b4badb9ed8b2525a3286f:topic
    

    Create ObsBucketNotifications Resource

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

    Constructor syntax

    new ObsBucketNotifications(name: string, args: ObsBucketNotificationsArgs, opts?: CustomResourceOptions);
    @overload
    def ObsBucketNotifications(resource_name: str,
                               args: ObsBucketNotificationsArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ObsBucketNotifications(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               bucket: Optional[str] = None,
                               notifications: Optional[Sequence[ObsBucketNotificationsNotificationArgs]] = None,
                               obs_bucket_notifications_id: Optional[str] = None)
    func NewObsBucketNotifications(ctx *Context, name string, args ObsBucketNotificationsArgs, opts ...ResourceOption) (*ObsBucketNotifications, error)
    public ObsBucketNotifications(string name, ObsBucketNotificationsArgs args, CustomResourceOptions? opts = null)
    public ObsBucketNotifications(String name, ObsBucketNotificationsArgs args)
    public ObsBucketNotifications(String name, ObsBucketNotificationsArgs args, CustomResourceOptions options)
    
    type: flexibleengine:ObsBucketNotifications
    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 ObsBucketNotificationsArgs
    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 ObsBucketNotificationsArgs
    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 ObsBucketNotificationsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ObsBucketNotificationsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ObsBucketNotificationsArgs
    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 obsBucketNotificationsResource = new Flexibleengine.ObsBucketNotifications("obsBucketNotificationsResource", new()
    {
        Bucket = "string",
        Notifications = new[]
        {
            new Flexibleengine.Inputs.ObsBucketNotificationsNotificationArgs
            {
                Events = new[]
                {
                    "string",
                },
                TopicUrn = "string",
                Name = "string",
                Prefix = "string",
                Suffix = "string",
            },
        },
        ObsBucketNotificationsId = "string",
    });
    
    example, err := flexibleengine.NewObsBucketNotifications(ctx, "obsBucketNotificationsResource", &flexibleengine.ObsBucketNotificationsArgs{
    	Bucket: pulumi.String("string"),
    	Notifications: flexibleengine.ObsBucketNotificationsNotificationArray{
    		&flexibleengine.ObsBucketNotificationsNotificationArgs{
    			Events: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			TopicUrn: pulumi.String("string"),
    			Name:     pulumi.String("string"),
    			Prefix:   pulumi.String("string"),
    			Suffix:   pulumi.String("string"),
    		},
    	},
    	ObsBucketNotificationsId: pulumi.String("string"),
    })
    
    var obsBucketNotificationsResource = new ObsBucketNotifications("obsBucketNotificationsResource", ObsBucketNotificationsArgs.builder()
        .bucket("string")
        .notifications(ObsBucketNotificationsNotificationArgs.builder()
            .events("string")
            .topicUrn("string")
            .name("string")
            .prefix("string")
            .suffix("string")
            .build())
        .obsBucketNotificationsId("string")
        .build());
    
    obs_bucket_notifications_resource = flexibleengine.ObsBucketNotifications("obsBucketNotificationsResource",
        bucket="string",
        notifications=[{
            "events": ["string"],
            "topic_urn": "string",
            "name": "string",
            "prefix": "string",
            "suffix": "string",
        }],
        obs_bucket_notifications_id="string")
    
    const obsBucketNotificationsResource = new flexibleengine.ObsBucketNotifications("obsBucketNotificationsResource", {
        bucket: "string",
        notifications: [{
            events: ["string"],
            topicUrn: "string",
            name: "string",
            prefix: "string",
            suffix: "string",
        }],
        obsBucketNotificationsId: "string",
    });
    
    type: flexibleengine:ObsBucketNotifications
    properties:
        bucket: string
        notifications:
            - events:
                - string
              name: string
              prefix: string
              suffix: string
              topicUrn: string
        obsBucketNotificationsId: string
    

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

    Bucket string
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    Notifications List<ObsBucketNotificationsNotification>

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    ObsBucketNotificationsId string
    The name of the bucket.
    Bucket string
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    Notifications []ObsBucketNotificationsNotificationArgs

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    ObsBucketNotificationsId string
    The name of the bucket.
    bucket String
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications List<ObsBucketNotificationsNotification>

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obsBucketNotificationsId String
    The name of the bucket.
    bucket string
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications ObsBucketNotificationsNotification[]

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obsBucketNotificationsId string
    The name of the bucket.
    bucket str
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications Sequence[ObsBucketNotificationsNotificationArgs]

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obs_bucket_notifications_id str
    The name of the bucket.
    bucket String
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications List<Property Map>

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obsBucketNotificationsId String
    The name of the bucket.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ObsBucketNotifications Resource

    Get an existing ObsBucketNotifications 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?: ObsBucketNotificationsState, opts?: CustomResourceOptions): ObsBucketNotifications
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket: Optional[str] = None,
            notifications: Optional[Sequence[ObsBucketNotificationsNotificationArgs]] = None,
            obs_bucket_notifications_id: Optional[str] = None) -> ObsBucketNotifications
    func GetObsBucketNotifications(ctx *Context, name string, id IDInput, state *ObsBucketNotificationsState, opts ...ResourceOption) (*ObsBucketNotifications, error)
    public static ObsBucketNotifications Get(string name, Input<string> id, ObsBucketNotificationsState? state, CustomResourceOptions? opts = null)
    public static ObsBucketNotifications get(String name, Output<String> id, ObsBucketNotificationsState state, CustomResourceOptions options)
    resources:  _:    type: flexibleengine:ObsBucketNotifications    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:
    Bucket string
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    Notifications List<ObsBucketNotificationsNotification>

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    ObsBucketNotificationsId string
    The name of the bucket.
    Bucket string
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    Notifications []ObsBucketNotificationsNotificationArgs

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    ObsBucketNotificationsId string
    The name of the bucket.
    bucket String
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications List<ObsBucketNotificationsNotification>

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obsBucketNotificationsId String
    The name of the bucket.
    bucket string
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications ObsBucketNotificationsNotification[]

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obsBucketNotificationsId string
    The name of the bucket.
    bucket str
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications Sequence[ObsBucketNotificationsNotificationArgs]

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obs_bucket_notifications_id str
    The name of the bucket.
    bucket String
    Specifies the name of the source bucket. Changing this parameter will create a new resource.
    notifications List<Property Map>

    Specifies the list of OBS bucket Notification Configurations. The notifications object structure is documented below.

    The notifications block supports:

    obsBucketNotificationsId String
    The name of the bucket.

    Supporting Types

    ObsBucketNotificationsNotification, ObsBucketNotificationsNotificationArgs

    Events List<string>
    Type of events that need to be notified. The events include ObjectCreated:*, ObjectCreated:Put, ObjectCreated:Post, ObjectCreated:Copy, ObjectCreated:CompleteMultipartUpload, ObjectRemoved:*, ObjectRemoved:Delete, ObjectRemoved:DeleteMarkerCreated.
    TopicUrn string
    Specifies the SMN topic that authorizes OBS to publish messages.
    Name string
    Specifies the name of OBS Notification. If not specified, the system assigns an ID automatically.
    Prefix string
    Specifies the prefix filtering rule. The value contains a maximum of 1024 characters.
    Suffix string
    Specifies the suffix filtering rule. The value contains a maximum of 1024 characters.
    Events []string
    Type of events that need to be notified. The events include ObjectCreated:*, ObjectCreated:Put, ObjectCreated:Post, ObjectCreated:Copy, ObjectCreated:CompleteMultipartUpload, ObjectRemoved:*, ObjectRemoved:Delete, ObjectRemoved:DeleteMarkerCreated.
    TopicUrn string
    Specifies the SMN topic that authorizes OBS to publish messages.
    Name string
    Specifies the name of OBS Notification. If not specified, the system assigns an ID automatically.
    Prefix string
    Specifies the prefix filtering rule. The value contains a maximum of 1024 characters.
    Suffix string
    Specifies the suffix filtering rule. The value contains a maximum of 1024 characters.
    events List<String>
    Type of events that need to be notified. The events include ObjectCreated:*, ObjectCreated:Put, ObjectCreated:Post, ObjectCreated:Copy, ObjectCreated:CompleteMultipartUpload, ObjectRemoved:*, ObjectRemoved:Delete, ObjectRemoved:DeleteMarkerCreated.
    topicUrn String
    Specifies the SMN topic that authorizes OBS to publish messages.
    name String
    Specifies the name of OBS Notification. If not specified, the system assigns an ID automatically.
    prefix String
    Specifies the prefix filtering rule. The value contains a maximum of 1024 characters.
    suffix String
    Specifies the suffix filtering rule. The value contains a maximum of 1024 characters.
    events string[]
    Type of events that need to be notified. The events include ObjectCreated:*, ObjectCreated:Put, ObjectCreated:Post, ObjectCreated:Copy, ObjectCreated:CompleteMultipartUpload, ObjectRemoved:*, ObjectRemoved:Delete, ObjectRemoved:DeleteMarkerCreated.
    topicUrn string
    Specifies the SMN topic that authorizes OBS to publish messages.
    name string
    Specifies the name of OBS Notification. If not specified, the system assigns an ID automatically.
    prefix string
    Specifies the prefix filtering rule. The value contains a maximum of 1024 characters.
    suffix string
    Specifies the suffix filtering rule. The value contains a maximum of 1024 characters.
    events Sequence[str]
    Type of events that need to be notified. The events include ObjectCreated:*, ObjectCreated:Put, ObjectCreated:Post, ObjectCreated:Copy, ObjectCreated:CompleteMultipartUpload, ObjectRemoved:*, ObjectRemoved:Delete, ObjectRemoved:DeleteMarkerCreated.
    topic_urn str
    Specifies the SMN topic that authorizes OBS to publish messages.
    name str
    Specifies the name of OBS Notification. If not specified, the system assigns an ID automatically.
    prefix str
    Specifies the prefix filtering rule. The value contains a maximum of 1024 characters.
    suffix str
    Specifies the suffix filtering rule. The value contains a maximum of 1024 characters.
    events List<String>
    Type of events that need to be notified. The events include ObjectCreated:*, ObjectCreated:Put, ObjectCreated:Post, ObjectCreated:Copy, ObjectCreated:CompleteMultipartUpload, ObjectRemoved:*, ObjectRemoved:Delete, ObjectRemoved:DeleteMarkerCreated.
    topicUrn String
    Specifies the SMN topic that authorizes OBS to publish messages.
    name String
    Specifies the name of OBS Notification. If not specified, the system assigns an ID automatically.
    prefix String
    Specifies the prefix filtering rule. The value contains a maximum of 1024 characters.
    suffix String
    Specifies the suffix filtering rule. The value contains a maximum of 1024 characters.

    Import

    OBS bucket notification configuration can be imported using the bucket, e.g.

    $ pulumi import flexibleengine:index/obsBucketNotifications:ObsBucketNotifications instance <bucket-name>
    

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

    Package Details

    Repository
    flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
    License
    Notes
    This Pulumi package is based on the flexibleengine Terraform Provider.
    flexibleengine logo
    flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud