gcp.storage.Notification
Explore with Pulumi AI
Creates a new notification configuration on a specified bucket, establishing a flow of event notifications from GCS to a Cloud Pub/Sub topic. For more information see the official documentation and API.
In order to enable notifications, a special Google Cloud Storage service account unique to the project
must exist and have the IAM permission “projects.topics.publish” for a Cloud Pub/Sub topic in the project.
This service account is not created automatically when a project is created.
To ensure the service account exists and obtain its email address for use in granting the correct IAM permission, use the
gcp.storage.getProjectServiceAccount
datasource’s email_address
value, and see below for an example of enabling notifications by granting the correct IAM permission.
See the notifications documentation for more details.
NOTE: This resource can affect your storage IAM policy. If you are using this in the same config as your storage IAM policy resources, consider making this resource dependent on those IAM resources via
depends_on
. This will safeguard against errors due to IAM race conditions.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
// Enable notifications by giving the correct IAM permission to the unique service account.
const gcsAccount = gcp.storage.getProjectServiceAccount({});
const topic = new gcp.pubsub.Topic("topic", {name: "default_topic"});
const binding = new gcp.pubsub.TopicIAMBinding("binding", {
topic: topic.id,
role: "roles/pubsub.publisher",
members: [gcsAccount.then(gcsAccount => `serviceAccount:${gcsAccount.emailAddress}`)],
});
// End enabling notifications
const bucket = new gcp.storage.Bucket("bucket", {
name: "default_bucket",
location: "US",
});
const notification = new gcp.storage.Notification("notification", {
bucket: bucket.name,
payloadFormat: "JSON_API_V1",
topic: topic.id,
eventTypes: [
"OBJECT_FINALIZE",
"OBJECT_METADATA_UPDATE",
],
customAttributes: {
"new-attribute": "new-attribute-value",
},
}, {
dependsOn: [binding],
});
import pulumi
import pulumi_gcp as gcp
# Enable notifications by giving the correct IAM permission to the unique service account.
gcs_account = gcp.storage.get_project_service_account()
topic = gcp.pubsub.Topic("topic", name="default_topic")
binding = gcp.pubsub.TopicIAMBinding("binding",
topic=topic.id,
role="roles/pubsub.publisher",
members=[f"serviceAccount:{gcs_account.email_address}"])
# End enabling notifications
bucket = gcp.storage.Bucket("bucket",
name="default_bucket",
location="US")
notification = gcp.storage.Notification("notification",
bucket=bucket.name,
payload_format="JSON_API_V1",
topic=topic.id,
event_types=[
"OBJECT_FINALIZE",
"OBJECT_METADATA_UPDATE",
],
custom_attributes={
"new-attribute": "new-attribute-value",
},
opts = pulumi.ResourceOptions(depends_on=[binding]))
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Enable notifications by giving the correct IAM permission to the unique service account.
gcsAccount, err := storage.GetProjectServiceAccount(ctx, nil, nil)
if err != nil {
return err
}
topic, err := pubsub.NewTopic(ctx, "topic", &pubsub.TopicArgs{
Name: pulumi.String("default_topic"),
})
if err != nil {
return err
}
binding, err := pubsub.NewTopicIAMBinding(ctx, "binding", &pubsub.TopicIAMBindingArgs{
Topic: topic.ID(),
Role: pulumi.String("roles/pubsub.publisher"),
Members: pulumi.StringArray{
pulumi.String(fmt.Sprintf("serviceAccount:%v", gcsAccount.EmailAddress)),
},
})
if err != nil {
return err
}
// End enabling notifications
bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
Name: pulumi.String("default_bucket"),
Location: pulumi.String("US"),
})
if err != nil {
return err
}
_, err = storage.NewNotification(ctx, "notification", &storage.NotificationArgs{
Bucket: bucket.Name,
PayloadFormat: pulumi.String("JSON_API_V1"),
Topic: topic.ID(),
EventTypes: pulumi.StringArray{
pulumi.String("OBJECT_FINALIZE"),
pulumi.String("OBJECT_METADATA_UPDATE"),
},
CustomAttributes: pulumi.StringMap{
"new-attribute": pulumi.String("new-attribute-value"),
},
}, pulumi.DependsOn([]pulumi.Resource{
binding,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
// Enable notifications by giving the correct IAM permission to the unique service account.
var gcsAccount = Gcp.Storage.GetProjectServiceAccount.Invoke();
var topic = new Gcp.PubSub.Topic("topic", new()
{
Name = "default_topic",
});
var binding = new Gcp.PubSub.TopicIAMBinding("binding", new()
{
Topic = topic.Id,
Role = "roles/pubsub.publisher",
Members = new[]
{
$"serviceAccount:{gcsAccount.Apply(getProjectServiceAccountResult => getProjectServiceAccountResult.EmailAddress)}",
},
});
// End enabling notifications
var bucket = new Gcp.Storage.Bucket("bucket", new()
{
Name = "default_bucket",
Location = "US",
});
var notification = new Gcp.Storage.Notification("notification", new()
{
Bucket = bucket.Name,
PayloadFormat = "JSON_API_V1",
Topic = topic.Id,
EventTypes = new[]
{
"OBJECT_FINALIZE",
"OBJECT_METADATA_UPDATE",
},
CustomAttributes =
{
{ "new-attribute", "new-attribute-value" },
},
}, new CustomResourceOptions
{
DependsOn =
{
binding,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.StorageFunctions;
import com.pulumi.gcp.storage.inputs.GetProjectServiceAccountArgs;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import com.pulumi.gcp.pubsub.TopicIAMBinding;
import com.pulumi.gcp.pubsub.TopicIAMBindingArgs;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.storage.Notification;
import com.pulumi.gcp.storage.NotificationArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
// Enable notifications by giving the correct IAM permission to the unique service account.
final var gcsAccount = StorageFunctions.getProjectServiceAccount();
var topic = new Topic("topic", TopicArgs.builder()
.name("default_topic")
.build());
var binding = new TopicIAMBinding("binding", TopicIAMBindingArgs.builder()
.topic(topic.id())
.role("roles/pubsub.publisher")
.members(String.format("serviceAccount:%s", gcsAccount.applyValue(getProjectServiceAccountResult -> getProjectServiceAccountResult.emailAddress())))
.build());
// End enabling notifications
var bucket = new Bucket("bucket", BucketArgs.builder()
.name("default_bucket")
.location("US")
.build());
var notification = new Notification("notification", NotificationArgs.builder()
.bucket(bucket.name())
.payloadFormat("JSON_API_V1")
.topic(topic.id())
.eventTypes(
"OBJECT_FINALIZE",
"OBJECT_METADATA_UPDATE")
.customAttributes(Map.of("new-attribute", "new-attribute-value"))
.build(), CustomResourceOptions.builder()
.dependsOn(binding)
.build());
}
}
resources:
notification:
type: gcp:storage:Notification
properties:
bucket: ${bucket.name}
payloadFormat: JSON_API_V1
topic: ${topic.id}
eventTypes:
- OBJECT_FINALIZE
- OBJECT_METADATA_UPDATE
customAttributes:
new-attribute: new-attribute-value
options:
dependson:
- ${binding}
binding:
type: gcp:pubsub:TopicIAMBinding
properties:
topic: ${topic.id}
role: roles/pubsub.publisher
members:
- serviceAccount:${gcsAccount.emailAddress}
# End enabling notifications
bucket:
type: gcp:storage:Bucket
properties:
name: default_bucket
location: US
topic:
type: gcp:pubsub:Topic
properties:
name: default_topic
variables:
# Enable notifications by giving the correct IAM permission to the unique service account.
gcsAccount:
fn::invoke:
Function: gcp:storage:getProjectServiceAccount
Arguments: {}
Create Notification Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Notification(name: string, args: NotificationArgs, opts?: CustomResourceOptions);
@overload
def Notification(resource_name: str,
args: NotificationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Notification(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
payload_format: Optional[str] = None,
topic: Optional[str] = None,
custom_attributes: Optional[Mapping[str, str]] = None,
event_types: Optional[Sequence[str]] = None,
object_name_prefix: Optional[str] = None)
func NewNotification(ctx *Context, name string, args NotificationArgs, opts ...ResourceOption) (*Notification, error)
public Notification(string name, NotificationArgs args, CustomResourceOptions? opts = null)
public Notification(String name, NotificationArgs args)
public Notification(String name, NotificationArgs args, CustomResourceOptions options)
type: gcp:storage:Notification
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 NotificationArgs
- 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 NotificationArgs
- 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 NotificationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NotificationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NotificationArgs
- 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 notificationResource = new Gcp.Storage.Notification("notificationResource", new()
{
Bucket = "string",
PayloadFormat = "string",
Topic = "string",
CustomAttributes =
{
{ "string", "string" },
},
EventTypes = new[]
{
"string",
},
ObjectNamePrefix = "string",
});
example, err := storage.NewNotification(ctx, "notificationResource", &storage.NotificationArgs{
Bucket: pulumi.String("string"),
PayloadFormat: pulumi.String("string"),
Topic: pulumi.String("string"),
CustomAttributes: pulumi.StringMap{
"string": pulumi.String("string"),
},
EventTypes: pulumi.StringArray{
pulumi.String("string"),
},
ObjectNamePrefix: pulumi.String("string"),
})
var notificationResource = new Notification("notificationResource", NotificationArgs.builder()
.bucket("string")
.payloadFormat("string")
.topic("string")
.customAttributes(Map.of("string", "string"))
.eventTypes("string")
.objectNamePrefix("string")
.build());
notification_resource = gcp.storage.Notification("notificationResource",
bucket="string",
payload_format="string",
topic="string",
custom_attributes={
"string": "string",
},
event_types=["string"],
object_name_prefix="string")
const notificationResource = new gcp.storage.Notification("notificationResource", {
bucket: "string",
payloadFormat: "string",
topic: "string",
customAttributes: {
string: "string",
},
eventTypes: ["string"],
objectNamePrefix: "string",
});
type: gcp:storage:Notification
properties:
bucket: string
customAttributes:
string: string
eventTypes:
- string
objectNamePrefix: string
payloadFormat: string
topic: string
Notification 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 Notification resource accepts the following input properties:
- Bucket string
- The name of the bucket.
- Payload
Format string - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - Topic string
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name. - Custom
Attributes Dictionary<string, string> - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- Event
Types List<string> - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- Object
Name stringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- Bucket string
- The name of the bucket.
- Payload
Format string - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - Topic string
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name. - Custom
Attributes map[string]string - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- Event
Types []string - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- Object
Name stringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- bucket String
- The name of the bucket.
- payload
Format String - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - topic String
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name. - custom
Attributes Map<String,String> - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event
Types List<String> - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- object
Name StringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- bucket string
- The name of the bucket.
- payload
Format string - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - topic string
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name. - custom
Attributes {[key: string]: string} - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event
Types string[] - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- object
Name stringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- bucket str
- The name of the bucket.
- payload_
format str - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - topic str
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name. - custom_
attributes Mapping[str, str] - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event_
types Sequence[str] - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- object_
name_ strprefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- bucket String
- The name of the bucket.
- payload
Format String - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - topic String
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name. - custom
Attributes Map<String> - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event
Types List<String> - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- object
Name StringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
Outputs
All input properties are implicitly available as output properties. Additionally, the Notification resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Notification
Id string - The ID of the created notification.
- Self
Link string - The URI of the created resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Notification
Id string - The ID of the created notification.
- Self
Link string - The URI of the created resource.
- id String
- The provider-assigned unique ID for this managed resource.
- notification
Id String - The ID of the created notification.
- self
Link String - The URI of the created resource.
- id string
- The provider-assigned unique ID for this managed resource.
- notification
Id string - The ID of the created notification.
- self
Link string - The URI of the created resource.
- id str
- The provider-assigned unique ID for this managed resource.
- notification_
id str - The ID of the created notification.
- self_
link str - The URI of the created resource.
- id String
- The provider-assigned unique ID for this managed resource.
- notification
Id String - The ID of the created notification.
- self
Link String - The URI of the created resource.
Look up Existing Notification Resource
Get an existing Notification 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?: NotificationState, opts?: CustomResourceOptions): Notification
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
custom_attributes: Optional[Mapping[str, str]] = None,
event_types: Optional[Sequence[str]] = None,
notification_id: Optional[str] = None,
object_name_prefix: Optional[str] = None,
payload_format: Optional[str] = None,
self_link: Optional[str] = None,
topic: Optional[str] = None) -> Notification
func GetNotification(ctx *Context, name string, id IDInput, state *NotificationState, opts ...ResourceOption) (*Notification, error)
public static Notification Get(string name, Input<string> id, NotificationState? state, CustomResourceOptions? opts = null)
public static Notification get(String name, Output<String> id, NotificationState 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.
- Bucket string
- The name of the bucket.
- Custom
Attributes Dictionary<string, string> - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- Event
Types List<string> - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- Notification
Id string - The ID of the created notification.
- Object
Name stringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- Payload
Format string - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - Self
Link string - The URI of the created resource.
- Topic string
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name.
- Bucket string
- The name of the bucket.
- Custom
Attributes map[string]string - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- Event
Types []string - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- Notification
Id string - The ID of the created notification.
- Object
Name stringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- Payload
Format string - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - Self
Link string - The URI of the created resource.
- Topic string
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name.
- bucket String
- The name of the bucket.
- custom
Attributes Map<String,String> - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event
Types List<String> - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- notification
Id String - The ID of the created notification.
- object
Name StringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- payload
Format String - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - self
Link String - The URI of the created resource.
- topic String
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name.
- bucket string
- The name of the bucket.
- custom
Attributes {[key: string]: string} - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event
Types string[] - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- notification
Id string - The ID of the created notification.
- object
Name stringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- payload
Format string - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - self
Link string - The URI of the created resource.
- topic string
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name.
- bucket str
- The name of the bucket.
- custom_
attributes Mapping[str, str] - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event_
types Sequence[str] - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- notification_
id str - The ID of the created notification.
- object_
name_ strprefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- payload_
format str - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - self_
link str - The URI of the created resource.
- topic str
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name.
- bucket String
- The name of the bucket.
- custom
Attributes Map<String> - A set of key/value attribute pairs to attach to each Cloud PubSub message published for this notification subscription
- event
Types List<String> - List of event type filters for this notification config. If not specified, Cloud Storage will send notifications for all event types. The valid types are:
"OBJECT_FINALIZE"
,"OBJECT_METADATA_UPDATE"
,"OBJECT_DELETE"
,"OBJECT_ARCHIVE"
- notification
Id String - The ID of the created notification.
- object
Name StringPrefix - Specifies a prefix path filter for this notification config. Cloud Storage will only send notifications for objects in this bucket whose names begin with the specified prefix.
- payload
Format String - The desired content of the Payload. One of
"JSON_API_V1"
or"NONE"
. - self
Link String - The URI of the created resource.
- topic String
- The Cloud PubSub topic to which this subscription publishes. Expects either the
topic name, assumed to belong to the default GCP provider project, or the project-level name,
i.e.
projects/my-gcp-project/topics/my-topic
ormy-topic
. If the project is not set in the provider, you will need to use the project-level name.
Import
Storage notifications can be imported using any of these accepted formats:
{{bucket_name}}/notificationConfigs/{{id}}
When using the pulumi import
command, Storage notifications can be imported using one of the formats above. For example:
$ pulumi import gcp:storage/notification:Notification default {{bucket_name}}/notificationConfigs/{{id}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.