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>
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]
func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)
func LookupDatabaseOutput(ctx *Context, args *LookupDatabaseOutputArgs, opts ...InvokeOption) LookupDatabaseResultOutput
> 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)
}
public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: google-native:spanner/v1:getDatabase
arguments:
# arguments dictionary
The following arguments are supported:
- Database
Id string - Instance
Id string - Project string
- Database
Id string - Instance
Id string - Project string
- database
Id String - instance
Id String - project String
- database
Id string - instance
Id string - project string
- database_
id str - instance_
id str - project str
- database
Id String - instance
Id String - project String
getDatabase Result
The following output properties are available:
- Create
Time string - If exists, the time at which the database creation started.
- Database
Dialect string - The dialect of the Cloud Spanner Database.
- Default
Leader 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.
- Earliest
Version stringTime - 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 boolProtection - 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 Pulumi.Google Native. Spanner. V1. Outputs. Encryption Config Response - 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 List<Pulumi.Google Native. Spanner. V1. Outputs. Encryption Info Response> - 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 theCREATE 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 Pulumi.Google Native. Spanner. V1. Outputs. Restore Info Response - Applicable only for restored databases. Contains information about the restore source.
- State string
- The current database state.
- Version
Retention stringPeriod - 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 string - If exists, the time at which the database creation started.
- Database
Dialect string - The dialect of the Cloud Spanner Database.
- Default
Leader 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.
- Earliest
Version stringTime - 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 boolProtection - 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 EncryptionConfig Response - 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 []EncryptionInfo Response - 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 theCREATE 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 RestoreInfo Response - Applicable only for restored databases. Contains information about the restore source.
- State string
- The current database state.
- Version
Retention stringPeriod - 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 String - If exists, the time at which the database creation started.
- database
Dialect String - The dialect of the Cloud Spanner Database.
- default
Leader 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.
- earliest
Version StringTime - 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 BooleanProtection - 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 EncryptionConfig Response - 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 List<EncryptionInfo Response> - 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 theCREATE 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.
- restore
Info RestoreInfo Response - Applicable only for restored databases. Contains information about the restore source.
- state String
- The current database state.
- version
Retention StringPeriod - 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 string - If exists, the time at which the database creation started.
- database
Dialect string - The dialect of the Cloud Spanner Database.
- default
Leader 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.
- earliest
Version stringTime - 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 booleanProtection - 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 EncryptionConfig Response - 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 EncryptionInfo Response[] - 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 theCREATE 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.
- restore
Info RestoreInfo Response - Applicable only for restored databases. Contains information about the restore source.
- state string
- The current database state.
- version
Retention stringPeriod - 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_ strtime - 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_ boolprotection - 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 EncryptionConfig Response - 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[EncryptionInfo Response] - 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 theCREATE 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 RestoreInfo Response - Applicable only for restored databases. Contains information about the restore source.
- state str
- The current database state.
- version_
retention_ strperiod - 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 String - If exists, the time at which the database creation started.
- database
Dialect String - The dialect of the Cloud Spanner Database.
- default
Leader 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.
- earliest
Version StringTime - 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 BooleanProtection - 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 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.
- encryption
Info 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 theCREATE 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.
- restore
Info Property Map - Applicable only for restored databases. Contains information about the restore source.
- state String
- The current database state.
- version
Retention StringPeriod - 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 string
- Name of the backup.
- Create
Time string - The time the CreateBackup request was received.
- Source
Database string - Name of the database the backup was created from.
- Version
Time string - The backup contains an externally consistent copy of
source_database
at the timestamp specified byversion_time
. If the CreateBackup request did not specifyversion_time
, theversion_time
of the backup is equivalent to thecreate_time
.
- Backup string
- Name of the backup.
- Create
Time string - The time the CreateBackup request was received.
- Source
Database string - Name of the database the backup was created from.
- Version
Time string - The backup contains an externally consistent copy of
source_database
at the timestamp specified byversion_time
. If the CreateBackup request did not specifyversion_time
, theversion_time
of the backup is equivalent to thecreate_time
.
- backup String
- Name of the backup.
- create
Time String - The time the CreateBackup request was received.
- source
Database String - Name of the database the backup was created from.
- version
Time String - The backup contains an externally consistent copy of
source_database
at the timestamp specified byversion_time
. If the CreateBackup request did not specifyversion_time
, theversion_time
of the backup is equivalent to thecreate_time
.
- backup string
- Name of the backup.
- create
Time string - The time the CreateBackup request was received.
- source
Database string - Name of the database the backup was created from.
- version
Time string - The backup contains an externally consistent copy of
source_database
at the timestamp specified byversion_time
. If the CreateBackup request did not specifyversion_time
, theversion_time
of the backup is equivalent to thecreate_time
.
- backup str
- Name of the backup.
- create_
time str - The time the CreateBackup request was received.
- source_
database str - Name of the database the backup was created from.
- version_
time str - The backup contains an externally consistent copy of
source_database
at the timestamp specified byversion_time
. If the CreateBackup request did not specifyversion_time
, theversion_time
of the backup is equivalent to thecreate_time
.
- backup String
- Name of the backup.
- create
Time String - The time the CreateBackup request was received.
- source
Database String - Name of the database the backup was created from.
- version
Time String - The backup contains an externally consistent copy of
source_database
at the timestamp specified byversion_time
. If the CreateBackup request did not specifyversion_time
, theversion_time
of the backup is equivalent to thecreate_time
.
EncryptionConfigResponse
- Kms
Key stringName - The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form
projects//locations//keyRings//cryptoKeys/
.
- Kms
Key stringName - The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form
projects//locations//keyRings//cryptoKeys/
.
- kms
Key StringName - The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form
projects//locations//keyRings//cryptoKeys/
.
- kms
Key stringName - The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form
projects//locations//keyRings//cryptoKeys/
.
- kms_
key_ strname - The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form
projects//locations//keyRings//cryptoKeys/
.
- kms
Key StringName - The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form
projects//locations//keyRings//cryptoKeys/
.
EncryptionInfoResponse
- Encryption
Status Pulumi.Google Native. Spanner. V1. Inputs. Status Response - 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 string - The type of encryption.
- Kms
Key stringVersion - A Cloud KMS key version that is being used to protect the database or backup.
- Encryption
Status 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 string - The type of encryption.
- Kms
Key stringVersion - A Cloud KMS key version that is being used to protect the database or backup.
- encryption
Status 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 String - The type of encryption.
- kms
Key StringVersion - A Cloud KMS key version that is being used to protect the database or backup.
- encryption
Status 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 string - The type of encryption.
- kms
Key stringVersion - A Cloud KMS key version that is being used to protect the database or backup.
- encryption_
status 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 str - The type of encryption.
- kms_
key_ strversion - A Cloud KMS key version that is being used to protect the database or backup.
- encryption
Status 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.
- encryption
Type String - The type of encryption.
- kms
Key StringVersion - A Cloud KMS key version that is being used to protect the database or backup.
RestoreInfoResponse
- Backup
Info Pulumi.Google Native. Spanner. V1. Inputs. Backup Info Response - Information about the backup used to restore the database. The backup may no longer exist.
- Source
Type string - The type of the restore source.
- Backup
Info BackupInfo Response - Information about the backup used to restore the database. The backup may no longer exist.
- Source
Type string - The type of the restore source.
- backup
Info BackupInfo Response - Information about the backup used to restore the database. The backup may no longer exist.
- source
Type String - The type of the restore source.
- backup
Info BackupInfo Response - Information about the backup used to restore the database. The backup may no longer exist.
- source
Type string - The type of the restore source.
- backup_
info BackupInfo Response - Information about the backup used to restore the database. The backup may no longer exist.
- source_
type str - The type of the restore source.
- backup
Info Property Map - Information about the backup used to restore the database. The backup may no longer exist.
- source
Type String - The type of the restore source.
StatusResponse
- Code int
- The status code, which should be an enum value of google.rpc.Code.
- Details
List<Immutable
Dictionary<string, string>> - A list of messages that carry the error details. There is a common set of message types for APIs to use.
- Message 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 int
- The status code, which should be an enum value of google.rpc.Code.
- Details []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 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 Integer
- The status code, which should be an enum value of google.rpc.Code.
- details 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 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 number
- The status code, which should be an enum value of google.rpc.Code.
- details {[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 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 int
- The status code, which should be an enum value of google.rpc.Code.
- details 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 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 Number
- The status code, which should be an enum value of google.rpc.Code.
- details 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 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