1. Packages
  2. Google Cloud Native
  3. API Docs
  4. spanner
  5. spanner/v1
  6. getDatabase

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

google-native.spanner/v1.getDatabase

Explore with Pulumi AI

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

Gets the state of a Cloud Spanner database.

Using getDatabase

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDatabase(args: GetDatabaseArgs, opts?: InvokeOptions): Promise<GetDatabaseResult>
function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: InvokeOptions): Output<GetDatabaseResult>
Copy
def get_database(database_id: Optional[str] = None,
                 instance_id: Optional[str] = None,
                 project: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
def get_database_output(database_id: Optional[pulumi.Input[str]] = None,
                 instance_id: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseResult]
Copy
func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)
func LookupDatabaseOutput(ctx *Context, args *LookupDatabaseOutputArgs, opts ...InvokeOption) LookupDatabaseResultOutput
Copy

> Note: This function is named LookupDatabase in the Go SDK.

public static class GetDatabase 
{
    public static Task<GetDatabaseResult> InvokeAsync(GetDatabaseArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabaseResult> Invoke(GetDatabaseInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
public static Output<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: google-native:spanner/v1:getDatabase
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DatabaseId This property is required. string
InstanceId This property is required. string
Project string
DatabaseId This property is required. string
InstanceId This property is required. string
Project string
databaseId This property is required. String
instanceId This property is required. String
project String
databaseId This property is required. string
instanceId This property is required. string
project string
database_id This property is required. str
instance_id This property is required. str
project str
databaseId This property is required. String
instanceId This property is required. String
project String

getDatabase Result

The following output properties are available:

CreateTime string
If exists, the time at which the database creation started.
DatabaseDialect string
The dialect of the Cloud Spanner Database.
DefaultLeader string
The read-write region which contains the database's leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
EarliestVersionTime string
Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
EnableDropProtection bool
Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.
EncryptionConfig Pulumi.GoogleNative.Spanner.V1.Outputs.EncryptionConfigResponse
For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
EncryptionInfo List<Pulumi.GoogleNative.Spanner.V1.Outputs.EncryptionInfoResponse>
For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
Name string
The name of the database. Values are of the form projects//instances//databases/, where `` is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.
Reconciling bool
If true, the database is being updated. If false, there are no ongoing update operations for the database.
RestoreInfo Pulumi.GoogleNative.Spanner.V1.Outputs.RestoreInfoResponse
Applicable only for restored databases. Contains information about the restore source.
State string
The current database state.
VersionRetentionPeriod string
The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
CreateTime string
If exists, the time at which the database creation started.
DatabaseDialect string
The dialect of the Cloud Spanner Database.
DefaultLeader string
The read-write region which contains the database's leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
EarliestVersionTime string
Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
EnableDropProtection bool
Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.
EncryptionConfig EncryptionConfigResponse
For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
EncryptionInfo []EncryptionInfoResponse
For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
Name string
The name of the database. Values are of the form projects//instances//databases/, where `` is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.
Reconciling bool
If true, the database is being updated. If false, there are no ongoing update operations for the database.
RestoreInfo RestoreInfoResponse
Applicable only for restored databases. Contains information about the restore source.
State string
The current database state.
VersionRetentionPeriod string
The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
createTime String
If exists, the time at which the database creation started.
databaseDialect String
The dialect of the Cloud Spanner Database.
defaultLeader String
The read-write region which contains the database's leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
earliestVersionTime String
Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
enableDropProtection Boolean
Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.
encryptionConfig EncryptionConfigResponse
For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
encryptionInfo List<EncryptionInfoResponse>
For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
name String
The name of the database. Values are of the form projects//instances//databases/, where `` is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.
reconciling Boolean
If true, the database is being updated. If false, there are no ongoing update operations for the database.
restoreInfo RestoreInfoResponse
Applicable only for restored databases. Contains information about the restore source.
state String
The current database state.
versionRetentionPeriod String
The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
createTime string
If exists, the time at which the database creation started.
databaseDialect string
The dialect of the Cloud Spanner Database.
defaultLeader string
The read-write region which contains the database's leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
earliestVersionTime string
Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
enableDropProtection boolean
Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.
encryptionConfig EncryptionConfigResponse
For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
encryptionInfo EncryptionInfoResponse[]
For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
name string
The name of the database. Values are of the form projects//instances//databases/, where `` is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.
reconciling boolean
If true, the database is being updated. If false, there are no ongoing update operations for the database.
restoreInfo RestoreInfoResponse
Applicable only for restored databases. Contains information about the restore source.
state string
The current database state.
versionRetentionPeriod string
The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
create_time str
If exists, the time at which the database creation started.
database_dialect str
The dialect of the Cloud Spanner Database.
default_leader str
The read-write region which contains the database's leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
earliest_version_time str
Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
enable_drop_protection bool
Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.
encryption_config EncryptionConfigResponse
For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
encryption_info Sequence[EncryptionInfoResponse]
For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
name str
The name of the database. Values are of the form projects//instances//databases/, where `` is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.
reconciling bool
If true, the database is being updated. If false, there are no ongoing update operations for the database.
restore_info RestoreInfoResponse
Applicable only for restored databases. Contains information about the restore source.
state str
The current database state.
version_retention_period str
The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
createTime String
If exists, the time at which the database creation started.
databaseDialect String
The dialect of the Cloud Spanner Database.
defaultLeader String
The read-write region which contains the database's leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
earliestVersionTime String
Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
enableDropProtection Boolean
Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.
encryptionConfig Property Map
For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
encryptionInfo List<Property Map>
For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
name String
The name of the database. Values are of the form projects//instances//databases/, where `` is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.
reconciling Boolean
If true, the database is being updated. If false, there are no ongoing update operations for the database.
restoreInfo Property Map
Applicable only for restored databases. Contains information about the restore source.
state String
The current database state.
versionRetentionPeriod String
The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.

Supporting Types

BackupInfoResponse

Backup This property is required. string
Name of the backup.
CreateTime This property is required. string
The time the CreateBackup request was received.
SourceDatabase This property is required. string
Name of the database the backup was created from.
VersionTime This property is required. string
The backup contains an externally consistent copy of source_database at the timestamp specified by version_time. If the CreateBackup request did not specify version_time, the version_time of the backup is equivalent to the create_time.
Backup This property is required. string
Name of the backup.
CreateTime This property is required. string
The time the CreateBackup request was received.
SourceDatabase This property is required. string
Name of the database the backup was created from.
VersionTime This property is required. string
The backup contains an externally consistent copy of source_database at the timestamp specified by version_time. If the CreateBackup request did not specify version_time, the version_time of the backup is equivalent to the create_time.
backup This property is required. String
Name of the backup.
createTime This property is required. String
The time the CreateBackup request was received.
sourceDatabase This property is required. String
Name of the database the backup was created from.
versionTime This property is required. String
The backup contains an externally consistent copy of source_database at the timestamp specified by version_time. If the CreateBackup request did not specify version_time, the version_time of the backup is equivalent to the create_time.
backup This property is required. string
Name of the backup.
createTime This property is required. string
The time the CreateBackup request was received.
sourceDatabase This property is required. string
Name of the database the backup was created from.
versionTime This property is required. string
The backup contains an externally consistent copy of source_database at the timestamp specified by version_time. If the CreateBackup request did not specify version_time, the version_time of the backup is equivalent to the create_time.
backup This property is required. str
Name of the backup.
create_time This property is required. str
The time the CreateBackup request was received.
source_database This property is required. str
Name of the database the backup was created from.
version_time This property is required. str
The backup contains an externally consistent copy of source_database at the timestamp specified by version_time. If the CreateBackup request did not specify version_time, the version_time of the backup is equivalent to the create_time.
backup This property is required. String
Name of the backup.
createTime This property is required. String
The time the CreateBackup request was received.
sourceDatabase This property is required. String
Name of the database the backup was created from.
versionTime This property is required. String
The backup contains an externally consistent copy of source_database at the timestamp specified by version_time. If the CreateBackup request did not specify version_time, the version_time of the backup is equivalent to the create_time.

EncryptionConfigResponse

KmsKeyName This property is required. string
The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form projects//locations//keyRings//cryptoKeys/.
KmsKeyName This property is required. string
The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form projects//locations//keyRings//cryptoKeys/.
kmsKeyName This property is required. String
The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form projects//locations//keyRings//cryptoKeys/.
kmsKeyName This property is required. string
The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form projects//locations//keyRings//cryptoKeys/.
kms_key_name This property is required. str
The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form projects//locations//keyRings//cryptoKeys/.
kmsKeyName This property is required. String
The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form projects//locations//keyRings//cryptoKeys/.

EncryptionInfoResponse

EncryptionStatus This property is required. Pulumi.GoogleNative.Spanner.V1.Inputs.StatusResponse
If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
EncryptionType This property is required. string
The type of encryption.
KmsKeyVersion This property is required. string
A Cloud KMS key version that is being used to protect the database or backup.
EncryptionStatus This property is required. StatusResponse
If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
EncryptionType This property is required. string
The type of encryption.
KmsKeyVersion This property is required. string
A Cloud KMS key version that is being used to protect the database or backup.
encryptionStatus This property is required. StatusResponse
If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
encryptionType This property is required. String
The type of encryption.
kmsKeyVersion This property is required. String
A Cloud KMS key version that is being used to protect the database or backup.
encryptionStatus This property is required. StatusResponse
If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
encryptionType This property is required. string
The type of encryption.
kmsKeyVersion This property is required. string
A Cloud KMS key version that is being used to protect the database or backup.
encryption_status This property is required. StatusResponse
If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
encryption_type This property is required. str
The type of encryption.
kms_key_version This property is required. str
A Cloud KMS key version that is being used to protect the database or backup.
encryptionStatus This property is required. Property Map
If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
encryptionType This property is required. String
The type of encryption.
kmsKeyVersion This property is required. String
A Cloud KMS key version that is being used to protect the database or backup.

RestoreInfoResponse

BackupInfo This property is required. Pulumi.GoogleNative.Spanner.V1.Inputs.BackupInfoResponse
Information about the backup used to restore the database. The backup may no longer exist.
SourceType This property is required. string
The type of the restore source.
BackupInfo This property is required. BackupInfoResponse
Information about the backup used to restore the database. The backup may no longer exist.
SourceType This property is required. string
The type of the restore source.
backupInfo This property is required. BackupInfoResponse
Information about the backup used to restore the database. The backup may no longer exist.
sourceType This property is required. String
The type of the restore source.
backupInfo This property is required. BackupInfoResponse
Information about the backup used to restore the database. The backup may no longer exist.
sourceType This property is required. string
The type of the restore source.
backup_info This property is required. BackupInfoResponse
Information about the backup used to restore the database. The backup may no longer exist.
source_type This property is required. str
The type of the restore source.
backupInfo This property is required. Property Map
Information about the backup used to restore the database. The backup may no longer exist.
sourceType This property is required. String
The type of the restore source.

StatusResponse

Code This property is required. int
The status code, which should be an enum value of google.rpc.Code.
Details This property is required. List<ImmutableDictionary<string, string>>
A list of messages that carry the error details. There is a common set of message types for APIs to use.
Message This property is required. string
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
Code This property is required. int
The status code, which should be an enum value of google.rpc.Code.
Details This property is required. []map[string]string
A list of messages that carry the error details. There is a common set of message types for APIs to use.
Message This property is required. string
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
code This property is required. Integer
The status code, which should be an enum value of google.rpc.Code.
details This property is required. List<Map<String,String>>
A list of messages that carry the error details. There is a common set of message types for APIs to use.
message This property is required. String
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
code This property is required. number
The status code, which should be an enum value of google.rpc.Code.
details This property is required. {[key: string]: string}[]
A list of messages that carry the error details. There is a common set of message types for APIs to use.
message This property is required. string
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
code This property is required. int
The status code, which should be an enum value of google.rpc.Code.
details This property is required. Sequence[Mapping[str, str]]
A list of messages that carry the error details. There is a common set of message types for APIs to use.
message This property is required. str
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
code This property is required. Number
The status code, which should be an enum value of google.rpc.Code.
details This property is required. List<Map<String>>
A list of messages that carry the error details. There is a common set of message types for APIs to use.
message This property is required. String
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.

Package Details

Repository
Google Cloud Native pulumi/pulumi-google-native
License
Apache-2.0

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi