DatabaseInstanceArgs class
The set of arguments for DatabaseInstance. The set of arguments for DatabaseInstance.
Constructors
-
DatabaseInstanceArgs({Input<
String?> ? backupdrBackup, Input<DatabaseInstanceClone?> ? clone, required Input<String> databaseVersion, Input<String?> ? deletionPolicy, Input<bool?> ? deletionProtection, Input<String?> ? encryptionKeyName, Input<bool?> ? enforceNewSqlNetworkArchitecture, Input<String?> ? finalBackupDescription, Input<bool?> ? includeReplicasForMajorVersionUpgrade, Input<String?> ? instanceType, Input<String?> ? maintenanceVersion, Input<String?> ? masterInstanceName, Input<String?> ? name, Input<int?> ? nodeCount, Input<DatabaseInstancePointInTimeRestoreContext?> ? pointInTimeRestoreContext, Input<String?> ? project, Input<String?> ? region, Input<DatabaseInstanceReplicaConfiguration?> ? replicaConfiguration, Input<List< ? replicaNames, Input<String> ?>DatabaseInstanceReplicationCluster?> ? replicationCluster, Input<DatabaseInstanceRestoreBackupContext?> ? restoreBackupContext, Input<String?> ? rootPassword, Input<String?> ? rootPasswordWo, Input<String?> ? rootPasswordWoVersion, Input<DatabaseInstanceSettings?> ? settings, Input<bool?> ? switchTransactionLogsToCloudStorageEnabled}) -
Creates a new DatabaseInstanceArgs.
backupdrBackupThe backupdrBackup needed to restore the database to a backup run. This field willcloneThe context needed to create this instance as a clone of another instance. When this field is set duringdatabaseVersionThe MySQL, PostgreSQL ordeletionPolicyWhether Terraform will be prevented from destroying the resource. Defaults to "DELETE".deletionProtectionWhether or not to allow the provider to destroy the instance. Unless this field is set to falseencryptionKeyNameThe full path to the encryption key used for the CMEK disk encryption. SettingenforceNewSqlNetworkArchitectureWhether to enforce the new SQL network architecture.finalBackupDescriptionThe description of final backup. Only set this field whenfinal_backup_config.enabledis true.includeReplicasForMajorVersionUpgradeWhen this parameter is set totrue, Cloud SQL instances can perform in-place major version upgrades of read replicas along with the primary instance whendatabaseVersionis updated. This is an input-only field that is not persisted in the API and only takes effect during a major version upgrade.instanceTypeThe type of the instance. See API reference for SqlInstanceType for supported values.maintenanceVersionThe current software version on the instance. This attribute can not be set during creation. Refer toavailableMaintenanceVersionsattribute to see whatmaintenanceVersionare available for upgrade. When this attribute gets updated, it will cause an instance restart. Setting amaintenanceVersionvalue that is older than the current one on the instance will be ignored.masterInstanceNameThe name of the existing instance that willnameThe name of the instance. If the name is leftnodeCountFor a read pool instance, the number of nodes in the read pool. For read pools with auto scaling enabled, this field is read only.pointInTimeRestoreContextThe pointInTimeRestoreContext needed for performing a point-in-time recovery of an instance managed by Google Cloud Backup and Disaster Recovery. This field willprojectThe ID of the project in which the resource belongs. If itregionThe region the instance will sit in. If a region is not provided in the resource definition,replicaConfigurationThe configuration for replication. ThereplicaNamesList of replica names. Can be updated.replicationClusterA primary instance and disaster recovery replica pair. Applicable to MySQL and PostgreSQL. This field can be set if the primary has psaWriteEndpoint set or both the primary and replica are created.restoreBackupContextThe context needed to restore the database to a backup run. This field willrootPasswordInitial root password. Can be updated. Required for MS SQL Server.rootPasswordWoNOTE: This field is write-only and its value will not be updated in state as part of read operations.rootPasswordWoVersionTriggers update ofrootPasswordWowrite-only. Increment this value when an update torootPasswordWois needed. For more info see updating write-only argumentssettingsThe settings to use for the database. TheswitchTransactionLogsToCloudStorageEnabledWhen set totrue, Cloud SQL instances can switch storing point-in-time recovery transaction logs from a data disk to Cloud Storage, freeing up data disk space and enabling longer retention windows. This is an input-only field that is not persisted in the API.const -
DatabaseInstanceArgs.fromMap(Map<
String, dynamic> map) -
factory
Properties
-
backupdrBackup
→ Input<
String?> ? -
The backupdrBackup needed to restore the database to a backup run. This field will
cause the provider to trigger the database to restore from the backup run indicated. The configuration is detailed below.
NOTE: Restoring from a backup is an imperative action and not recommended via this provider. Adding or modifying this
block during resource creation/update will trigger the restore action after the resource is created/updated.
final
-
clone
→ Input<
DatabaseInstanceClone?> ? -
The context needed to create this instance as a clone of another instance. When this field is set during
resource creation, this provider will attempt to clone another instance as indicated in the context. The
configuration is detailed below.
final
-
databaseVersion
→ Input<
String> -
The MySQL, PostgreSQL or
SQL Server version to use. Supported values include
MYSQL_5_6,MYSQL_5_7,MYSQL_8_0,MYSQL_8_4,POSTGRES_9_6,POSTGRES_10,POSTGRES_11,POSTGRES_12,POSTGRES_13,POSTGRES_14,POSTGRES_15,POSTGRES_16,POSTGRES_17,POSTGRES_18,SQLSERVER_2022_STANDARD,SQLSERVER_2022_ENTERPRISE,SQLSERVER_2022_EXPRESS,SQLSERVER_2022_WEB,SQLSERVER_2025_STANDARD,SQLSERVER_2025_ENTERPRISE,SQLSERVER_2025_EXPRESS,SQLSERVER_2025_WEB. Database Version Policies includes an up-to-date reference of supported versions.final -
deletionPolicy
→ Input<
String?> ? -
Whether Terraform will be prevented from destroying the resource. Defaults to "DELETE".
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
final
-
deletionProtection
→ Input<
bool?> ? -
Whether or not to allow the provider to destroy the instance. Unless this field is set to false
in state, a
destroyorupdatecommand that deletes the instance will fail. Defaults totrue.final -
encryptionKeyName
→ Input<
String?> ? -
The full path to the encryption key used for the CMEK disk encryption. Setting
up disk encryption currently requires manual steps outside of this provider.
The provided key must be in the same region as the SQL instance. In order
to use this feature, a special kind of service account must be created and
granted permission on this key. This step can currently only be done
manually, please see this step.
That service account needs the
Cloud KMS > Cloud KMS CryptoKey Encrypter/Decrypterrole on your key - please see this step.final -
enforceNewSqlNetworkArchitecture
→ Input<
bool?> ? -
Whether to enforce the new SQL network architecture.
By default, new Cloud SQL instances created in projects created after August 2021 use the new network architecture.
This follows the gcloud pattern where the flag is an irreversible opt-in.
See official documentation for more details.
final
-
finalBackupDescription
→ Input<
String?> ? -
The description of final backup. Only set this field when
final_backup_config.enabledis true.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
includeReplicasForMajorVersionUpgrade
→ Input<
bool?> ? -
When this parameter is set to
true, Cloud SQL instances can perform in-place major version upgrades of read replicas along with the primary instance whendatabaseVersionis updated. This is an input-only field that is not persisted in the API and only takes effect during a major version upgrade.final -
instanceType
→ Input<
String?> ? -
The type of the instance. See API reference for SqlInstanceType for supported values.
final
-
maintenanceVersion
→ Input<
String?> ? -
The current software version on the instance. This attribute can not be set during creation. Refer to
availableMaintenanceVersionsattribute to see whatmaintenanceVersionare available for upgrade. When this attribute gets updated, it will cause an instance restart. Setting amaintenanceVersionvalue that is older than the current one on the instance will be ignored.final -
masterInstanceName
→ Input<
String?> ? -
The name of the existing instance that will
act as the master in the replication setup. Note, this requires the master to
have
binaryLogEnabledset, as well as existing backups.final -
name
→ Input<
String?> ? -
The name of the instance. If the name is left
blank, the provider will randomly generate one when the instance is first
created. This is done because after a name is used, it cannot be reused for
up to one week.
final
-
nodeCount
→ Input<
int?> ? -
For a read pool instance, the number of nodes in the read pool. For read pools with auto scaling enabled, this field is read only.
final
-
pointInTimeRestoreContext
→ Input<
DatabaseInstancePointInTimeRestoreContext?> ? -
The pointInTimeRestoreContext needed for performing a point-in-time recovery of an instance managed by Google Cloud Backup and Disaster Recovery. This field will
cause Terraform to trigger the database to restore to a point in time indicated. The configuration is detailed below.
NOTE: Restoring from a backup is an imperative action and not recommended via this provider. Adding or modifying this
block during resource creation/update will trigger the restore action after the resource is created/updated.
final
-
project
→ Input<
String?> ? -
The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
final
-
region
→ Input<
String?> ? -
The region the instance will sit in. If a region is not provided in the resource definition,
the provider region will be used instead.
final
-
replicaConfiguration
→ Input<
DatabaseInstanceReplicaConfiguration?> ? -
The configuration for replication. The
configuration is detailed below.
final
-
replicaNames
→ Input<
List< ?String> ?> -
List of replica names. Can be updated.
final
-
replicationCluster
→ Input<
DatabaseInstanceReplicationCluster?> ? -
A primary instance and disaster recovery replica pair. Applicable to MySQL and PostgreSQL. This field can be set if the primary has psaWriteEndpoint set or both the primary and replica are created.
final
-
restoreBackupContext
→ Input<
DatabaseInstanceRestoreBackupContext?> ? -
The context needed to restore the database to a backup run. This field will
cause the provider to trigger the database to restore from the backup run indicated. The configuration is detailed below.
NOTE: Restoring from a backup is an imperative action and not recommended via this provider. Adding or modifying this
block during resource creation/update will trigger the restore action after the resource is created/updated.
final
-
rootPassword
→ Input<
String?> ? -
Initial root password. Can be updated. Required for MS SQL Server.
final
-
rootPasswordWo
→ Input<
String?> ? -
NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Initial root password. Can be updated. Required for MS SQL Server. Note: This property is write-only and will not be read from the API.
final
-
rootPasswordWoVersion
→ Input<
String?> ? -
Triggers update of
rootPasswordWowrite-only. Increment this value when an update torootPasswordWois needed. For more info see updating write-only argumentsfinal - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
settings
→ Input<
DatabaseInstanceSettings?> ? -
The settings to use for the database. The
configuration is detailed below. Required if
cloneis not set.final -
switchTransactionLogsToCloudStorageEnabled
→ Input<
bool?> ? -
When set to
true, Cloud SQL instances can switch storing point-in-time recovery transaction logs from a data disk to Cloud Storage, freeing up data disk space and enabling longer retention windows. This is an input-only field that is not persisted in the API.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited