Skip to content
Open
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
40 changes: 40 additions & 0 deletions mmv1/products/firestore/Database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ examples:
- 'project'
- 'etag'
- 'deletion_policy'
- name: 'firestore_database_data_access'
primary_resource_id: 'firestore_access_database'
vars:
database_id: 'data-access-database-id'
test_env_vars:
project_id: 'PROJECT_NAME'
ignore_read_extra:
- 'project'
- 'etag'
- 'deletion_policy'
virtual_fields:
- name: 'deletion_policy'
description: |
Expand Down Expand Up @@ -207,6 +217,36 @@ properties:
enum_values:
- 'STANDARD'
- 'ENTERPRISE'
- name: 'firestoreDataAccessMode'
type: Enum
description: |
The Firestore API data access mode to use for this database.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if one of these is set for a Datastore mode database? (Same question about Mongo-compat API for Datastore mode).

And if the Firestore API data access mode is enabled, does that allow using the Datastore API against that database?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are blocked by the backend.

Trying to create an ENTERPRISE database in datastore-mode throws this error:
INVALID_ARGUMENT: Enterprise Edition is only supported for Firestore Native databases.

Trying to create a STANDARD database datastore-mode with one of the data-access modes throws this error:
INVALID_ARGUMENT: Only Enterprise Edition is allowed to set Data Access Mode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. In that case let's just leave something in the descriptions specifying the allowed editions and modes.

required: false
default_from_api: true
immutable: true
enum_values:
- 'DATA_ACCESS_MODE_ENABLED'
- 'DATA_ACCESS_MODE_DISABLED'
- name: 'mongodbCompatibleDataAccessMode'
type: Enum
description: |
The MongoDB compatible API data access mode to use for this database.
required: false
default_from_api: true
immutable: true
enum_values:
- 'DATA_ACCESS_MODE_ENABLED'
- 'DATA_ACCESS_MODE_DISABLED'
- name: 'realtimeUpdatesMode'
type: Enum
description: |
The Realtime Updates mode to use for this database..
required: false
default_from_api: true
immutable: true
enum_values:
- 'REALTIME_UPDATES_MODE_ENABLED'
- 'REALTIME_UPDATES_MODE_DISABLED'
- name: 'concurrencyMode'
type: Enum
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "google_firestore_database" "{{$.PrimaryResourceId}}" {
project = "{{index $.TestEnvVars "project_id"}}"
name = "{{index $.Vars "database_id"}}"
location_id = "nam5"
type = "FIRESTORE_NATIVE"
database_edition = "ENTERPRISE"
firestore_data_access_mode = "DATA_ACCESS_MODE_ENABLED"
mongodb_compatible_data_access_mode = "DATA_ACCESS_MODE_DISABLED"
realtime_updates_mode = "REALTIME_UPDATES_MODE_DISABLED"
deletion_policy = "DELETE"
}
Loading