permalink |
---|
/spanner_database/ |
spanner_database
represents the google_spanner_database
Terraform resource.
This package contains functions and utilities for setting up the resource using Jsonnet code.
fn new()
fn newAttrs()
fn withDatabaseDialect()
fn withDdl()
fn withDeletionProtection()
fn withEnableDropProtection()
fn withEncryptionConfig()
fn withEncryptionConfigMixin()
fn withInstance()
fn withName()
fn withProject()
fn withTimeouts()
fn withTimeoutsMixin()
fn withVersionRetentionPeriod()
obj encryption_config
obj timeouts
new()
google.spanner_database.new
injects a new google_spanner_database
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.spanner_database.new('some_id')
You can get the reference to the id
field of the created google.spanner_database
using the reference:
$._ref.google_spanner_database.some_id.get('id')
This is the same as directly entering "${ google_spanner_database.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.database_dialect
(string
): The dialect of the Cloud Spanner Database. If it is not provided, "GOOGLE_STANDARD_SQL" will be used. Possible values: ["GOOGLE_STANDARD_SQL", "POSTGRESQL"] Whennull
, thedatabase_dialect
field will be omitted from the resulting object.ddl
(list
): An optional list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created. Whennull
, theddl
field will be omitted from the resulting object.deletion_protection
(bool
): Whether or not to allow Terraform to destroy the database. Defaults to true. Unless this field is set to false in Terraform state, a 'terraform destroy' or 'terraform apply' that would delete the database will fail. Whennull
, thedeletion_protection
field will be omitted from the resulting object.enable_drop_protection
(bool
): Whether drop protection is enabled for this database. Defaults to false. Drop protection is different from the "deletion_protection" attribute in the following ways: (1) "deletion_protection" only protects the database from deletions in Terraform. whereas setting “enableDropProtection” to true protects the database from deletions in all interfaces. (2) Setting "enableDropProtection" to true also prevents the deletion of the parent instance containing the database. "deletion_protection" attribute does not provide protection against the deletion of the parent instance. Whennull
, theenable_drop_protection
field will be omitted from the resulting object.instance
(string
): The instance to create the database on.name
(string
): A unique identifier for the database, which cannot be changed after the instance is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].project
(string
): Set theproject
field on the resulting resource block. Whennull
, theproject
field will be omitted from the resulting object.version_retention_period
(string
): The retention period for the database. The retention period must be between 1 hour and 7 days, and can be specified in days, hours, minutes, or seconds. For example, the values 1d, 24h, 1440m, and 86400s are equivalent. Default value is 1h. If this property is used, you must avoid adding new DDL statements to 'ddl' that update the database's version_retention_period. Whennull
, theversion_retention_period
field will be omitted from the resulting object.encryption_config
(list[obj]
): Encryption configuration for the database Whennull
, theencryption_config
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.spanner_database.encryption_config.new constructor.timeouts
(obj
): Set thetimeouts
field on the resulting resource block. Whennull
, thetimeouts
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.spanner_database.timeouts.new constructor.
Returns:
- A mixin object that injects the new resource into the root Terraform configuration.
newAttrs()
google.spanner_database.newAttrs
constructs a new object with attributes and blocks configured for the spanner_database
Terraform resource.
Unlike google.spanner_database.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:
database_dialect
(string
): The dialect of the Cloud Spanner Database. If it is not provided, "GOOGLE_STANDARD_SQL" will be used. Possible values: ["GOOGLE_STANDARD_SQL", "POSTGRESQL"] Whennull
, thedatabase_dialect
field will be omitted from the resulting object.ddl
(list
): An optional list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created. Whennull
, theddl
field will be omitted from the resulting object.deletion_protection
(bool
): Whether or not to allow Terraform to destroy the database. Defaults to true. Unless this field is set to false in Terraform state, a 'terraform destroy' or 'terraform apply' that would delete the database will fail. Whennull
, thedeletion_protection
field will be omitted from the resulting object.enable_drop_protection
(bool
): Whether drop protection is enabled for this database. Defaults to false. Drop protection is different from the "deletion_protection" attribute in the following ways: (1) "deletion_protection" only protects the database from deletions in Terraform. whereas setting “enableDropProtection” to true protects the database from deletions in all interfaces. (2) Setting "enableDropProtection" to true also prevents the deletion of the parent instance containing the database. "deletion_protection" attribute does not provide protection against the deletion of the parent instance. Whennull
, theenable_drop_protection
field will be omitted from the resulting object.instance
(string
): The instance to create the database on.name
(string
): A unique identifier for the database, which cannot be changed after the instance is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].project
(string
): Set theproject
field on the resulting object. Whennull
, theproject
field will be omitted from the resulting object.version_retention_period
(string
): The retention period for the database. The retention period must be between 1 hour and 7 days, and can be specified in days, hours, minutes, or seconds. For example, the values 1d, 24h, 1440m, and 86400s are equivalent. Default value is 1h. If this property is used, you must avoid adding new DDL statements to 'ddl' that update the database's version_retention_period. Whennull
, theversion_retention_period
field will be omitted from the resulting object.encryption_config
(list[obj]
): Encryption configuration for the database Whennull
, theencryption_config
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.spanner_database.encryption_config.new constructor.timeouts
(obj
): Set thetimeouts
field on the resulting object. Whennull
, thetimeouts
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.spanner_database.timeouts.new constructor.
Returns:
- An attribute object that can be used with tf.withResource to construct a new
spanner_database
resource into the root Terraform configuration.
withDatabaseDialect()
google.string.withDatabaseDialect
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the database_dialect field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for thedatabase_dialect
field.
withDdl()
google.list.withDdl
constructs a mixin object that can be merged into the list
Terraform resource block to set or update the ddl field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(list
): The value to set for theddl
field.
withDeletionProtection()
google.bool.withDeletionProtection
constructs a mixin object that can be merged into the bool
Terraform resource block to set or update the deletion_protection field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(bool
): The value to set for thedeletion_protection
field.
withEnableDropProtection()
google.bool.withEnableDropProtection
constructs a mixin object that can be merged into the bool
Terraform resource block to set or update the enable_drop_protection field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(bool
): The value to set for theenable_drop_protection
field.
withEncryptionConfig()
google.list[obj].withEncryptionConfig
constructs a mixin object that can be merged into the list[obj]
Terraform resource block to set or update the encryption_config 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].withEncryptionConfigMixin function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(list[obj]
): The value to set for theencryption_config
field.
withEncryptionConfigMixin()
google.list[obj].withEncryptionConfigMixin
constructs a mixin object that can be merged into the list[obj]
Terraform resource block to set or update the encryption_config 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].withEncryptionConfig
function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(list[obj]
): The value to set for theencryption_config
field.
withInstance()
google.string.withInstance
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the instance field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for theinstance
field.
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 thename
field.
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 theproject
field.
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 thetimeouts
field.
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 thetimeouts
field.
withVersionRetentionPeriod()
google.string.withVersionRetentionPeriod
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the version_retention_period field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for theversion_retention_period
field.
new()
google.spanner_database.encryption_config.new
constructs a new object with attributes and blocks configured for the encryption_config
Terraform sub block.
Args:
kms_key_name
(string
): Fully qualified name of the KMS key to use to encrypt this database. This key must exist in the same location as the Spanner Database.
Returns:
- An attribute object that represents the
encryption_config
sub block.
new()
google.spanner_database.timeouts.new
constructs a new object with attributes and blocks configured for the timeouts
Terraform sub block.
Args:
create
(string
): Set thecreate
field on the resulting object. Whennull
, thecreate
field will be omitted from the resulting object.delete
(string
): Set thedelete
field on the resulting object. Whennull
, thedelete
field will be omitted from the resulting object.update
(string
): Set theupdate
field on the resulting object. Whennull
, theupdate
field will be omitted from the resulting object.
Returns:
- An attribute object that represents the
timeouts
sub block.