Skip to content

New data sources: google_discovery_engine_data_store(s)#16637

Open
mahdilamb wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
mahdilamb:feat/discovery-engine-data-store-datasources
Open

New data sources: google_discovery_engine_data_store(s)#16637
mahdilamb wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
mahdilamb:feat/discovery-engine-data-store-datasources

Conversation

@mahdilamb
Copy link

@mahdilamb mahdilamb commented Mar 7, 2026

Wrote this using Claude to add discoveryengine datastores. Tried to follow the style of google_storage_bucket(s), but to cover a few more use cases. I have reviewed the generated code myself.

Fixes hashicorp/terraform-provider-google#26375

Add two new handwritten data sources for Discovery Engine data stores:

  • google_discovery_engine_data_store (singular) — Look up a single data store by data_store_id or display_name. When looking up by display name, lists all stores and returns an error if zero or multiple matches are found.
  • google_discovery_engine_data_stores (plural) — List all data stores in a given project and location.

Both data sources:

  • Default location to "global" and inherit project from the provider if not set
  • Support regional endpoints automatically via {{DiscoveryEngineBasePath}}
  • Include acceptance tests and documentation

Files added/modified

  • data_source_discovery_engine_data_store.go — singular data source
  • data_source_discovery_engine_data_stores.go — plural data source
  • data_source_discovery_engine_data_store_test.go — singular acceptance test (by ID + by display_name)
  • data_source_discovery_engine_data_stores_test.go — plural acceptance test
  • discovery_engine_data_store.html.markdown — singular docs
  • discovery_engine_data_stores.html.markdown — plural docs
  • provider_mmv1_resources.go.tmpl — register both data sources

Generated with Claude Code (Claude Opus 4.6)

Added `google_discovery_engine_data_store` data source for reading a single Discovery Engine data store by ID or display name
Added `google_discovery_engine_data_stores` data source for listing all Discovery Engine data stores in a project and location

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 7, 2026
@google-cla
Copy link

google-cla bot commented Mar 7, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@malhotrasagar2212, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

Add two handwritten data sources for Discovery Engine data stores:

- `google_discovery_engine_data_store`: retrieves a single data store
  by `data_store_id` or `display_name` (mutually exclusive). Errors if
  multiple stores share the same display name.
- `google_discovery_engine_data_stores`: lists all data stores in a
  project/location with pagination support.

Both default `location` to "global" and inherit `project` from the
provider config when not specified. The singular data source reuses
the existing resource's flatten helpers.
@mahdilamb mahdilamb force-pushed the feat/discovery-engine-data-store-datasources branch from f757f26 to 07d4218 Compare March 7, 2026 09:15
@modular-magician modular-magician added service/discoveryengine and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Mar 10, 2026
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 7 files changed, 677 insertions(+))
google-beta provider: Diff ( 7 files changed, 677 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 34
Skipped tests: 3
Affected tests: 3

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataSourceGoogleDiscoveryEngineDataStore_basic
  • TestAccDataSourceGoogleDiscoveryEngineDataStore_byDisplayName
  • TestAccDataSourceGoogleDiscoveryEngineDataStores_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccDataSourceGoogleDiscoveryEngineDataStore_basic [Debug log]
TestAccDataSourceGoogleDiscoveryEngineDataStore_byDisplayName [Debug log]
TestAccDataSourceGoogleDiscoveryEngineDataStores_basic [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New data source: google_discovery_engine_data_store(s)

2 participants