Skip to content

Latest commit

 

History

History
400 lines (258 loc) · 15.7 KB

pubsub_topic.md

File metadata and controls

400 lines (258 loc) · 15.7 KB
permalink
/pubsub_topic/

pubsub_topic

pubsub_topic represents the google_pubsub_topic Terraform resource.

This package contains functions and utilities for setting up the resource using Jsonnet code.

Index

Fields

fn new

new()

google.pubsub_topic.new injects a new google_pubsub_topic Terraform resource block into the root module document.

Additionally, this inserts a private function into the _ref attribute that generates references to attributes of the resource. For example, if you added a new instance to the root using:

# arguments omitted for brevity
google.pubsub_topic.new('some_id')

You can get the reference to the id field of the created google.pubsub_topic using the reference:

$._ref.google_pubsub_topic.some_id.get('id')

This is the same as directly entering "${ google_pubsub_topic.some_id.id }" as the value.

NOTE: if you are chaining multiple resources together in a merge operation, you may not be able to use super, self, or $ to refer to the root object. Instead, make an explicit outer object using local.

Args:

  • resourceLabel (string): The name label of the block.
  • kms_key_name (string): The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account ('service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com') must have 'roles/cloudkms.cryptoKeyEncrypterDecrypter' to use this feature. The expected format is 'projects//locations//keyRings//cryptoKeys/' When null, the kms_key_name field will be omitted from the resulting object.
  • labels (obj): A set of key/value label pairs to assign to this Topic. When null, the labels field will be omitted from the resulting object.
  • message_retention_duration (string): Indicates the minimum duration to retain a message after it is published to the topic. If this field is set, messages published to the topic in the last messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. Cannot be more than 31 days or less than 10 minutes. When null, the message_retention_duration field will be omitted from the resulting object.
  • name (string): Name of the topic.
  • project (string): Set the project field on the resulting resource block. When null, the project field will be omitted from the resulting object.
  • message_storage_policy (list[obj]): Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. When null, the message_storage_policy sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.pubsub_topic.message_storage_policy.new constructor.
  • schema_settings (list[obj]): Settings for validating messages published against a schema. When null, the schema_settings sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.pubsub_topic.schema_settings.new constructor.
  • timeouts (obj): Set the timeouts field on the resulting resource block. When null, the timeouts sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.pubsub_topic.timeouts.new constructor.

Returns:

  • A mixin object that injects the new resource into the root Terraform configuration.

fn newAttrs

newAttrs()

google.pubsub_topic.newAttrs constructs a new object with attributes and blocks configured for the pubsub_topic Terraform resource.

Unlike google.pubsub_topic.new, this function will not inject the resource block into the root Terraform document. Instead, this must be passed in as the attrs argument for the tf.withResource function to build a complete block.

This is most useful when you need to preprocess the attributes with functions, conditional, or looping logic prior to injecting into a complete block.

Args:

  • kms_key_name (string): The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account ('service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com') must have 'roles/cloudkms.cryptoKeyEncrypterDecrypter' to use this feature. The expected format is 'projects//locations//keyRings//cryptoKeys/' When null, the kms_key_name field will be omitted from the resulting object.
  • labels (obj): A set of key/value label pairs to assign to this Topic. When null, the labels field will be omitted from the resulting object.
  • message_retention_duration (string): Indicates the minimum duration to retain a message after it is published to the topic. If this field is set, messages published to the topic in the last messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. Cannot be more than 31 days or less than 10 minutes. When null, the message_retention_duration field will be omitted from the resulting object.
  • name (string): Name of the topic.
  • project (string): Set the project field on the resulting object. When null, the project field will be omitted from the resulting object.
  • message_storage_policy (list[obj]): Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. When null, the message_storage_policy sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.pubsub_topic.message_storage_policy.new constructor.
  • schema_settings (list[obj]): Settings for validating messages published against a schema. When null, the schema_settings sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.pubsub_topic.schema_settings.new constructor.
  • timeouts (obj): Set the timeouts field on the resulting object. When null, the timeouts sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.pubsub_topic.timeouts.new constructor.

Returns:

  • An attribute object that can be used with tf.withResource to construct a new pubsub_topic resource into the root Terraform configuration.

fn withKmsKeyName

withKmsKeyName()

google.string.withKmsKeyName constructs a mixin object that can be merged into the string Terraform resource block to set or update the kms_key_name field.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (string): The value to set for the kms_key_name field.

fn withLabels

withLabels()

google.obj.withLabels constructs a mixin object that can be merged into the obj Terraform resource block to set or update the labels field.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (obj): The value to set for the labels field.

fn withMessageRetentionDuration

withMessageRetentionDuration()

google.string.withMessageRetentionDuration constructs a mixin object that can be merged into the string Terraform resource block to set or update the message_retention_duration field.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (string): The value to set for the message_retention_duration field.

fn withMessageStoragePolicy

withMessageStoragePolicy()

google.list[obj].withMessageStoragePolicy constructs a mixin object that can be merged into the list[obj] Terraform resource block to set or update the message_storage_policy field.

This function will replace the array with the passed in value. If you wish to instead append the passed in value to the existing array, use the google.list[obj].withMessageStoragePolicyMixin function.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (list[obj]): The value to set for the message_storage_policy field.

fn withMessageStoragePolicyMixin

withMessageStoragePolicyMixin()

google.list[obj].withMessageStoragePolicyMixin constructs a mixin object that can be merged into the list[obj] Terraform resource block to set or update the message_storage_policy field.

This function will append the passed in array or object to the existing array. If you wish to instead replace the array with the passed in value, use the google.list[obj].withMessageStoragePolicy function.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (list[obj]): The value to set for the message_storage_policy field.

fn withName

withName()

google.string.withName constructs a mixin object that can be merged into the string Terraform resource block to set or update the name field.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (string): The value to set for the name field.

fn withProject

withProject()

google.string.withProject constructs a mixin object that can be merged into the string Terraform resource block to set or update the project field.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (string): The value to set for the project field.

fn withSchemaSettings

withSchemaSettings()

google.list[obj].withSchemaSettings constructs a mixin object that can be merged into the list[obj] Terraform resource block to set or update the schema_settings field.

This function will replace the array with the passed in value. If you wish to instead append the passed in value to the existing array, use the google.list[obj].withSchemaSettingsMixin function.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (list[obj]): The value to set for the schema_settings field.

fn withSchemaSettingsMixin

withSchemaSettingsMixin()

google.list[obj].withSchemaSettingsMixin constructs a mixin object that can be merged into the list[obj] Terraform resource block to set or update the schema_settings field.

This function will append the passed in array or object to the existing array. If you wish to instead replace the array with the passed in value, use the google.list[obj].withSchemaSettings function.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (list[obj]): The value to set for the schema_settings field.

fn withTimeouts

withTimeouts()

google.obj.withTimeouts constructs a mixin object that can be merged into the obj Terraform resource block to set or update the timeouts field.

This function will replace the map with the passed in value. If you wish to instead merge the passed in value to the existing map, use the google.obj.withTimeoutsMixin function.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (obj): The value to set for the timeouts field.

fn withTimeoutsMixin

withTimeoutsMixin()

google.obj.withTimeoutsMixin constructs a mixin object that can be merged into the obj Terraform resource block to set or update the timeouts field.

This function will merge the passed in value to the existing map. If you wish to instead replace the entire map with the passed in value, use the google.obj.withTimeouts function.

Args:

  • resourceLabel (string): The name label of the block to update.
  • value (obj): The value to set for the timeouts field.

obj message_storage_policy

fn message_storage_policy.new

new()

google.pubsub_topic.message_storage_policy.new constructs a new object with attributes and blocks configured for the message_storage_policy Terraform sub block.

Args:

  • allowed_persistence_regions (list): A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

Returns:

  • An attribute object that represents the message_storage_policy sub block.

obj schema_settings

fn schema_settings.new

new()

google.pubsub_topic.schema_settings.new constructs a new object with attributes and blocks configured for the schema_settings Terraform sub block.

Args:

  • encoding (string): The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"] When null, the encoding field will be omitted from the resulting object.
  • schema (string): The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.

Returns:

  • An attribute object that represents the schema_settings sub block.

obj timeouts

fn timeouts.new

new()

google.pubsub_topic.timeouts.new constructs a new object with attributes and blocks configured for the timeouts Terraform sub block.

Args:

  • create (string): Set the create field on the resulting object. When null, the create field will be omitted from the resulting object.
  • delete (string): Set the delete field on the resulting object. When null, the delete field will be omitted from the resulting object.
  • update (string): Set the update field on the resulting object. When null, the update field will be omitted from the resulting object.

Returns:

  • An attribute object that represents the timeouts sub block.