Database
A Cloud Firestore Database. If you wish to use Firestore with App Engine, use the gcp.appengine.Application
resource instead. To get more information about Database, see:
How-to Guides
Example Usage
Firestore Database With Delete Protection
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.firestore.Database;
import com.pulumi.gcp.firestore.DatabaseArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var database = new Database("database", DatabaseArgs.builder()
.project(google_project.project().project_id())
.locationId("nam5")
.type("FIRESTORE_NATIVE")
.deleteProtectionState("DELETE_PROTECTION_ENABLED")
.build(), CustomResourceOptions.builder()
.dependsOn(google_project_service.firestore())
.build());
}
}
Import
Database can be imported using any of these accepted formats
$ pulumi import gcp:firestore/database:Database default projects/{{project}}/databases/{{name}}
$ pulumi import gcp:firestore/database:Database default {{project}}/{{name}}
$ pulumi import gcp:firestore/database:Database default {{name}}
Properties
The App Engine integration mode to use for this database. Possible values are: ENABLED
, DISABLED
.
The concurrency control mode to use for this database. Possible values are: OPTIMISTIC
, PESSIMISTIC
, OPTIMISTIC_WITH_ENTITY_GROUPS
.
Output only. The timestamp at which this database was created.
State of delete protection for the database. Possible values are: DELETE_PROTECTION_STATE_UNSPECIFIED
, DELETE_PROTECTION_ENABLED
, DELETE_PROTECTION_DISABLED
.
Output only. The earliest timestamp at which older versions of the data can be read from the database. See versionRetentionPeriod above; this field is populated with now - versionRetentionPeriod. This value is continuously updated, 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. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
Output only. The keyPrefix for this database. This keyPrefix is used, in combination with the project id ("~") to construct the application id that is returned from the Cloud Datastore APIs in Google App Engine first generation runtimes. This value may be empty in which case the appid to use for URL-encoded keys is the project_id (eg: foo instead of v~foo).
The location of the database. Available locations are listed at https://cloud.google.com/firestore/docs/locations.
The ID to use for the database, which will become the final component of the database's resource name. This value should be 4-63 characters. Valid characters are /0-9-/ with first character a letter and the last a letter or a number. Must not be UUID-like /0-9a-f{8}(-0-9a-f{4}){3}-0-9a-f{12}/. "(default)" database id is also valid.
Whether to enable the PITR feature on this database. If POINT_IN_TIME_RECOVERY_ENABLED
is selected, reads are supported on selected versions of the data from within the past 7 days. versionRetentionPeriod and earliestVersionTime can be used to determine the supported versions. These include reads against any timestamp within the past hour and reads against 1-minute snapshots beyond 1 hour and within 7 days. If POINT_IN_TIME_RECOVERY_DISABLED
is selected, reads are supported on any version of the data from within the past 1 hour. Default value is POINT_IN_TIME_RECOVERY_DISABLED
. Possible values are: POINT_IN_TIME_RECOVERY_ENABLED
, POINT_IN_TIME_RECOVERY_DISABLED
.
Output only. The timestamp at which this database was most recently updated.
Output only. The period during which past versions of data are retained in the database. Any read or query can specify a readTime within this window, and will read the state of the database at that time. If the PITR feature is enabled, the retention period is 7 days. Otherwise, the retention period is 1 hour. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".