Database Args
A Cloud Firestore Database. If you wish to use Firestore with App Engine, use the gcp.appengine.Application resource instead. If you were previously using the gcp.appengine.Application resource exclusively for managing a Firestore database and would like to use the gcp.firestore.Database resource instead, please follow the instructions here. To get more information about Database, see:
How-to Guides
Example Usage
Firestore Database
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 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()
.appEngineIntegrationMode("DISABLED")
.concurrencyMode("OPTIMISTIC")
.locationId("nam5")
.pointInTimeRecoveryEnablement("POINT_IN_TIME_RECOVERY_ENABLED")
.project("my-project-name")
.type("FIRESTORE_NATIVE")
.build());
}
}Firestore Database In Datastore Mode
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 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 datastoreModeDatabase = new Database("datastoreModeDatabase", DatabaseArgs.builder()
.appEngineIntegrationMode("DISABLED")
.concurrencyMode("OPTIMISTIC")
.locationId("nam5")
.pointInTimeRecoveryEnablement("POINT_IN_TIME_RECOVERY_ENABLED")
.project("my-project-name")
.type("DATASTORE_MODE")
.build());
}
}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 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()
.deleteProtectionState("DELETE_PROTECTION_ENABLED")
.locationId("nam5")
.project("my-project-name")
.type("FIRESTORE_NATIVE")
.build());
}
}Import
Database can be imported using any of these accepted formats* projects/{{project}}/databases/{{name}} * {{project}}/{{name}} * {{name}} In Terraform v1.5.0 and later, use an import block to import Database using one of the formats above. For exampletf import { id = "projects/{{project}}/databases/{{name}}" to = google_firestore_database.default }
$ pulumi import gcp:firestore/database:Database When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Database can be imported using one of the formats above. For example$ 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}}Constructors
Functions
Properties
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.