Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore: Add support for Point-in-time-recovery (PITR) #8907

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions mmv1/products/firestore/Database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ properties:
- :PESSIMISTIC
- :OPTIMISTIC_WITH_ENTITY_GROUPS
default_from_api: true
- !ruby/object:Api::Type::Enum
name: pointInTimeRecoveryEnablement
description: |
Whether to enable the PITR feature on this database.
When disabled allows reads against any version within the last hour.
When enabled allows reads against any version within the last last hour and
reads against 1-minute snapshots beyond 1 hour and within 7 days.
`version_retention_period` and `earliest_version_time` can be used to determine the supported versions.
values:
- :POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED
- :POINT_IN_TIME_RECOVERY_ENABLED
- :POINT_IN_TIME_RECOVERY_DISABLED
default_from_api: true
- !ruby/object:Api::Type::Enum
name: appEngineIntegrationMode
description: |
Expand All @@ -147,6 +160,21 @@ properties:
- :ENABLED
- :DISABLED
default_from_api: true
- !ruby/object:Api::Type::String
name: version_retention_period
description: |
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".
output: true
- !ruby/object:Api::Type::String
name: earliest_version_time
description: |
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: true
- !ruby/object:Api::Type::String
name: key_prefix
description: |
Expand Down
2 changes: 2 additions & 0 deletions mmv1/templates/terraform/examples/firestore_database.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ resource "google_firestore_database" "<%= ctx[:primary_resource_id] %>" {
concurrency_mode = "OPTIMISTIC"
app_engine_integration_mode = "DISABLED"

point_in_time_recovery_enablement = "POINT_IN_TIME_RECOVERY_ENABLED"

depends_on = [google_project_service.firestore]
}