Class SpannerDatabaseConfig.Builder
- java.lang.Object
-
- com.hashicorp.cdktf.providers.google.spanner_database.SpannerDatabaseConfig.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<SpannerDatabaseConfig>
- Enclosing interface:
- SpannerDatabaseConfig
@Stability(Stable) public static final class SpannerDatabaseConfig.Builder extends Object implements software.amazon.jsii.Builder<SpannerDatabaseConfig>
A builder forSpannerDatabaseConfig
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
instance
@Stability(Stable) public SpannerDatabaseConfig.Builder instance(String instance)
Sets the value ofSpannerDatabaseConfig.getInstance()- Parameters:
instance- The instance to create the database on. This parameter is required. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#instance SpannerDatabase#instance}- Returns:
this
-
name
@Stability(Stable) public SpannerDatabaseConfig.Builder name(String name)
Sets the value ofSpannerDatabaseConfig.getName()- Parameters:
name- A unique identifier for the database, which cannot be changed after the instance is created. This parameter is required. Values are of the form [a-z][-a-z0-9]*[a-z0-9]. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#name SpannerDatabase#name}- Returns:
this
-
databaseDialect
@Stability(Stable) public SpannerDatabaseConfig.Builder databaseDialect(String databaseDialect)
Sets the value ofSpannerDatabaseConfig.getDatabaseDialect()- Parameters:
databaseDialect- The dialect of the Cloud Spanner Database. If it is not provided, "GOOGLE_STANDARD_SQL" will be used. Possible values: ["GOOGLE_STANDARD_SQL", "POSTGRESQL"]. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#database_dialect SpannerDatabase#database_dialect}- Returns:
this
-
ddl
@Stability(Stable) public SpannerDatabaseConfig.Builder ddl(List<String> ddl)
Sets the value ofSpannerDatabaseConfig.getDdl()- Parameters:
ddl- 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#ddl SpannerDatabase#ddl}- Returns:
this
-
deletionProtection
@Stability(Stable) public SpannerDatabaseConfig.Builder deletionProtection(Boolean deletionProtection)
Sets the value ofSpannerDatabaseConfig.getDeletionProtection()- Parameters:
deletionProtection- Whether Terraform will be prevented from destroying the database. Defaults to true. When a'terraform destroy' or 'terraform apply' would delete the database, the command will fail if this field is not set to false in Terraform state. When the field is set to true or unset in Terraform state, a 'terraform apply' or 'terraform destroy' that would delete the database will fail. When the field is set to false, deleting the database is allowed. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#deletion_protection SpannerDatabase#deletion_protection}- Returns:
this
-
deletionProtection
@Stability(Stable) public SpannerDatabaseConfig.Builder deletionProtection(com.hashicorp.cdktf.IResolvable deletionProtection)
Sets the value ofSpannerDatabaseConfig.getDeletionProtection()- Parameters:
deletionProtection- Whether Terraform will be prevented from destroying the database. Defaults to true. When a'terraform destroy' or 'terraform apply' would delete the database, the command will fail if this field is not set to false in Terraform state. When the field is set to true or unset in Terraform state, a 'terraform apply' or 'terraform destroy' that would delete the database will fail. When the field is set to false, deleting the database is allowed. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#deletion_protection SpannerDatabase#deletion_protection}- Returns:
this
-
enableDropProtection
@Stability(Stable) public SpannerDatabaseConfig.Builder enableDropProtection(Boolean enableDropProtection)
Sets the value ofSpannerDatabaseConfig.getEnableDropProtection()- Parameters:
enableDropProtection- 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#enable_drop_protection SpannerDatabase#enable_drop_protection}- Returns:
this
-
enableDropProtection
@Stability(Stable) public SpannerDatabaseConfig.Builder enableDropProtection(com.hashicorp.cdktf.IResolvable enableDropProtection)
Sets the value ofSpannerDatabaseConfig.getEnableDropProtection()- Parameters:
enableDropProtection- 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#enable_drop_protection SpannerDatabase#enable_drop_protection}- Returns:
this
-
encryptionConfig
@Stability(Stable) public SpannerDatabaseConfig.Builder encryptionConfig(SpannerDatabaseEncryptionConfig encryptionConfig)
Sets the value ofSpannerDatabaseConfig.getEncryptionConfig()- Parameters:
encryptionConfig- encryption_config block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#encryption_config SpannerDatabase#encryption_config}- Returns:
this
-
id
@Stability(Stable) public SpannerDatabaseConfig.Builder id(String id)
Sets the value ofSpannerDatabaseConfig.getId()- Parameters:
id- Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#id SpannerDatabase#id}. Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable.- Returns:
this
-
project
@Stability(Stable) public SpannerDatabaseConfig.Builder project(String project)
Sets the value ofSpannerDatabaseConfig.getProject()- Parameters:
project- Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#project SpannerDatabase#project}.- Returns:
this
-
timeouts
@Stability(Stable) public SpannerDatabaseConfig.Builder timeouts(SpannerDatabaseTimeouts timeouts)
Sets the value ofSpannerDatabaseConfig.getTimeouts()- Parameters:
timeouts- timeouts block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#timeouts SpannerDatabase#timeouts}- Returns:
this
-
versionRetentionPeriod
@Stability(Stable) public SpannerDatabaseConfig.Builder versionRetentionPeriod(String versionRetentionPeriod)
Sets the value ofSpannerDatabaseConfig.getVersionRetentionPeriod()- Parameters:
versionRetentionPeriod- 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/spanner_database#version_retention_period SpannerDatabase#version_retention_period}- Returns:
this
-
connection
@Stability(Experimental) public SpannerDatabaseConfig.Builder connection(com.hashicorp.cdktf.SSHProvisionerConnection connection)
Sets the value ofTerraformMetaArguments.getConnection()- Parameters:
connection- the value to be set.- Returns:
this
-
connection
@Stability(Experimental) public SpannerDatabaseConfig.Builder connection(com.hashicorp.cdktf.WinrmProvisionerConnection connection)
Sets the value ofTerraformMetaArguments.getConnection()- Parameters:
connection- the value to be set.- Returns:
this
-
count
@Stability(Experimental) public SpannerDatabaseConfig.Builder count(Number count)
Sets the value ofTerraformMetaArguments.getCount()- Parameters:
count- the value to be set.- Returns:
this
-
count
@Stability(Experimental) public SpannerDatabaseConfig.Builder count(com.hashicorp.cdktf.TerraformCount count)
Sets the value ofTerraformMetaArguments.getCount()- Parameters:
count- the value to be set.- Returns:
this
-
dependsOn
@Stability(Experimental) public SpannerDatabaseConfig.Builder dependsOn(List<? extends com.hashicorp.cdktf.ITerraformDependable> dependsOn)
Sets the value ofTerraformMetaArguments.getDependsOn()- Parameters:
dependsOn- the value to be set.- Returns:
this
-
forEach
@Stability(Experimental) public SpannerDatabaseConfig.Builder forEach(com.hashicorp.cdktf.ITerraformIterator forEach)
Sets the value ofTerraformMetaArguments.getForEach()- Parameters:
forEach- the value to be set.- Returns:
this
-
lifecycle
@Stability(Experimental) public SpannerDatabaseConfig.Builder lifecycle(com.hashicorp.cdktf.TerraformResourceLifecycle lifecycle)
Sets the value ofTerraformMetaArguments.getLifecycle()- Parameters:
lifecycle- the value to be set.- Returns:
this
-
provider
@Stability(Experimental) public SpannerDatabaseConfig.Builder provider(com.hashicorp.cdktf.TerraformProvider provider)
Sets the value ofTerraformMetaArguments.getProvider()- Parameters:
provider- the value to be set.- Returns:
this
-
provisioners
@Stability(Experimental) public SpannerDatabaseConfig.Builder provisioners(List<? extends Object> provisioners)
Sets the value ofTerraformMetaArguments.getProvisioners()- Parameters:
provisioners- the value to be set.- Returns:
this
-
build
@Stability(Stable) public SpannerDatabaseConfig build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<SpannerDatabaseConfig>- Returns:
- a new instance of
SpannerDatabaseConfig - Throws:
NullPointerException- if any required attribute was not provided
-
-