StorageNotification

Property Value
Google Cloud Service Name Cloud Storage
Google Cloud Service Documentation /storage/docs/
Google Cloud REST Resource Name v1.notifications
Google Cloud REST Resource Documentation /storage/docs/json_api/v1/notifications
Config Connector Resource Short Names gcpstoragenotification
gcpstoragenotifications
storagenotification
Config Connector Service Name storage.googleapis.com
Config Connector Resource Fully Qualified Name storagenotifications.storage.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No

Custom Resource Definition Properties

Spec

Schema

  bucketRef:
    external: string
    name: string
    namespace: string
  customAttributes:
    string: string
  eventTypes:
  - string
  objectNamePrefix: string
  payloadFormat: string
  resourceID: string
  topicRef:
    external: string
    name: string
    namespace: string
Fields

bucketRef

Required

object

bucketRef.external

Optional

string

The name of a StorageBucket.

bucketRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

bucketRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

customAttributes

Optional

map (key: string, value: string)

Immutable. A set of key/value attribute pairs to attach to each Cloud Pub/Sub message published for this notification subscription

eventTypes

Optional

list (string)

Immutable. 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"

eventTypes.[]

Optional

string

objectNamePrefix

Optional

string

Immutable. 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.

payloadFormat

Required

string

Immutable. The desired content of the Payload. One of "JSON_API_V1" or "NONE".

resourceID

Optional

string

Immutable. Optional. The service-generated notificationId of the resource. Used for acquisition only. Leave unset to create a new resource.

topicRef

Required

object

topicRef.external

Optional

string

The name of a PubSubTopic.

topicRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

topicRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

Status

Schema

  conditions:
  - lastTransitionTime: string
    message: string
    reason: string
    status: string
    type: string
  notificationId: string
  selfLink: string
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource's current state.

conditions.[]

object

conditions.[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions.[].message

string

Human-readable message indicating details about last transition.

conditions.[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions.[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions.[].type

string

Type is the type of the condition.

notificationId

string

The ID of the created notification.

selfLink

string

The URI of the created resource.

Sample YAML(s)

Typical Use Case

  # Copyright 2020 Google LLC
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #     http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  apiVersion: storage.cnrm.cloud.google.com/v1beta1
  kind: StorageNotification
  metadata:
    name: storagenotification-sample
  spec:
    bucketRef:
      name: ${PROJECT_ID?}-storagenotification-dep
    payloadFormat: JSON_API_V1
    topicRef:
      name: storagenotification-dep
    eventTypes:
      - "OBJECT_ARCHIVE"
  ---
  apiVersion: iam.cnrm.cloud.google.com/v1beta1
  kind: IAMPolicyMember
  metadata:
    name: storagenotification-dep
  spec:
    # replace ${PROJECT_NUMBER?} with your project name
    member: serviceAccount:service-${PROJECT_NUMBER?}@gs-project-accounts.iam.gserviceaccount.com
    role: roles/pubsub.publisher
    resourceRef:
      apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
      kind: PubSubTopic
      name: storagenotification-dep
  ---
  apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
  kind: PubSubTopic
  metadata:
    labels:
      label-one: "value-one"
    name: storagenotification-dep
  ---
  apiVersion: storage.cnrm.cloud.google.com/v1beta1
  kind: StorageBucket
  metadata:
    # StorageBucket names must be globally unique. Replace ${PROJECT_ID?} with your project ID.
    name: ${PROJECT_ID?}-storagenotification-dep