Skip to content

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Aug 27, 2025

Changes

When importing account-level storage credentials, the metastore ID was not being interpolated correctly, causing API calls to fail with malformed URLs containing double slashes (/api/2.0/accounts/.../metastores//storage-credentials/...). This occurred because during import, the Terraform state is empty and d.Get("metastore_id") returned an empty string.

Added a parseStorageCredentialId() function that handles composite IDs in the format metastore_id|storage_credential_name for account-level imports, extracting the metastore ID and setting it in the state before making API calls. This maintains backward compatibility with workspace-level imports using simple credential names and includes comprehensive unit tests and updated documentation.

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • using Go SDK
  • using TF Plugin Framework
  • has entry in NEXT_CHANGELOG.md file

Fixes: ES-1561726

…mports

This commit fixes the issue where importing account-level storage credentials
fails with a missing metastore ID in the API call. The problem occurred because
the import ID format "metastore_id|storage_credential_name" was not being parsed
correctly during the read operation.

Changes:
- Added parseStorageCredentialId function to handle composite ID format
- Modified read operation to parse and extract metastore_id from composite IDs
- Added comprehensive unit tests for both account-level and workspace-level imports
- Updated documentation with new import format examples

Resolves: ES-1561726

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@mgyucht mgyucht requested review from a team as code owners August 27, 2025 14:49
@mgyucht mgyucht requested review from renaudhartert-db and removed request for a team August 27, 2025 14:49
@mgyucht mgyucht temporarily deployed to test-trigger-is August 27, 2025 14:49 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 27, 2025 14:50 — with GitHub Actions Inactive
Also update documentation to clarify provider level terminology.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@mgyucht mgyucht temporarily deployed to test-trigger-is August 27, 2025 14:54 — with GitHub Actions Inactive
@mgyucht mgyucht requested a review from rauchy August 27, 2025 14:54
@mgyucht mgyucht temporarily deployed to test-trigger-is August 27, 2025 14:54 — with GitHub Actions Inactive
@mgyucht mgyucht changed the title Fix metastore ID interpolation for account-level storage credential imports [Fix] Fix metastore ID interpolation for account-level storage credential imports Aug 27, 2025
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@mgyucht mgyucht temporarily deployed to test-trigger-is August 27, 2025 15:05 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 27, 2025 15:06 — with GitHub Actions Inactive
Comment on lines 13 to 14
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"makefile.configureOnOpen": false
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is unintentional change

@mgyucht mgyucht temporarily deployed to test-trigger-is August 28, 2025 08:25 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 28, 2025 08:26 — with GitHub Actions Inactive
@rauchy rauchy temporarily deployed to test-trigger-is August 28, 2025 09:17 — with GitHub Actions Inactive
@rauchy rauchy temporarily deployed to test-trigger-is August 28, 2025 09:18 — with GitHub Actions Inactive
alexott and others added 6 commits August 28, 2025 11:27
## Changes
<!-- Summary of your changes that are easy to understand -->

There are new fields in Go SDK for `databricks_vector_search_index` and
`databricks_model_serving` resources, so documenting them.

## Tests
<!--
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [x] `make test` run locally
- [ ] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] using Go SDK
- [ ] using TF Plugin Framework
- [x] has entry in `NEXT_CHANGELOG.md` file

Co-authored-by: Omer Lachish <[email protected]>
## Changes
<!-- Summary of your changes that are easy to understand -->

## Tests
<!--
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [x] `make test` run locally
- [x] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] using Go SDK
- [ ] using TF Plugin Framework
- [x] has entry in `NEXT_CHANGELOG.md` file
## Changes
<!-- Summary of your changes that are easy to understand -->

`databricks_budget` is the only resource in the `FinOps` category, so it
makes sense to unify with the rest of billing-related resources

NO_CHANGELOG=true


## Tests
<!--
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [ ] `make test` run locally
- [x] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] using Go SDK
- [ ] using TF Plugin Framework
- [ ] has entry in `NEXT_CHANGELOG.md` file
## Changes
<!-- Summary of your changes that are easy to understand -->

## Tests
<!--
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [ ] `make test` run locally
- [ ] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] using Go SDK
- [ ] using TF Plugin Framework
- [ ] has entry in `NEXT_CHANGELOG.md` file

NO_CHANGELOG=true

Co-authored-by: Omer Lachish <[email protected]>
- Resolves #4866
- Also marks `databricks_app` GA

<!--
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [x] `make test` run locally
- [x] covered with integration tests in `internal/acceptance`
- [x] using Go SDK
- [x] using TF Plugin Framework
- [x] has entry in `NEXT_CHANGELOG.md` file

---------

Co-authored-by: Alex Ott <[email protected]>
Co-authored-by: Omer Lachish <[email protected]>
@mgyucht mgyucht temporarily deployed to test-trigger-is August 28, 2025 11:29 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 28, 2025 11:30 — with GitHub Actions Inactive
@alexott alexott temporarily deployed to test-trigger-is August 28, 2025 18:33 — with GitHub Actions Inactive
@alexott alexott enabled auto-merge August 28, 2025 18:33
@alexott alexott temporarily deployed to test-trigger-is August 28, 2025 18:34 — with GitHub Actions Inactive
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 4980
  • Commit SHA: 423f8b5c3d626137399824412514f52361c8a099

Checks will be approved automatically on success.

@alexott alexott added this pull request to the merge queue Aug 29, 2025
Merged via the queue into main with commit 461ec8a Aug 29, 2025
12 checks passed
@alexott alexott deleted the fix/storage-credential-import-metastore-id branch August 29, 2025 13:17
deco-sdk-tagging bot added a commit that referenced this pull request Sep 1, 2025
## Release v1.88.0

### New Features and Improvements

* Document and handle additional Slack options in `databricks_notification_destination` ([#4933](#4933))
* Lower case `warehouse_name_contains` when comparing in `databricks_warehouses` ([#4966](#4966))
* Added `account_federation_policies` resource and data sources ([#4986](#4986)).
* Added `account_setting_v2` resource and data sources ([#4986](#4986)).
* Added `account_settings_metadata_v2` resource and data sources ([#4986](#4986)).
* Added `apps_settings_custom_template` resource and data sources ([#4986](#4986)).
* Added `entity_tag_assignment` resource and data sources ([#4986](#4986)).
* Added `service_principal_federation_policies` resource and data sources ([#4986](#4986)).
* Added `tag_policy` resource and data sources ([#4986](#4986)).
* Added `workspace_setting_v2` resource and data sources ([#4986](#4986)).
* Added `workspace_settings_metadata_v2` resource and data sources ([#4986](#4986)).

### Bug Fixes

* Suppress diff for `databricks_catalog` attributes ([#4975](#4975))
* Correct which file event fields should be reset in `databricks_external_location` ([#4945](#4945))
* Fix `ExactlyOneOf` in `databricks_app` ([#4946](#4946))
* Enable update of `databricks_mws_ncc_private_endpoint_rule` resource ([#4957](#4957))
* Fix metastore ID interpolation for account-level storage credential imports ([#4980](#4980)). Storage credentials can now be imported using two formats: `<storage_credential_name>` when using a workspace-level provider, and `<metastore_id>|<storage_credential_name>` when using an account-level provider. Previously, importing storage credentials with an account-level provider would fail due to missing metastore ID in the API call.

### Documentation

* Improve documentation for grant resource ([#4906](#4935))
* Document `gcp_attributes.first_on_demand` attribute in `databricks_cluster` ([#4934](#4934))
* Improve `databricks_mws_permission_assignment` documentation ([#4943](#4943))
* Update `databricks_job` example to use `environment_version` ([#4942](#4942))
* Fix broken link in docs/index.md ([#4949](#4949))
* Update existing docs to match Go SDK 0.81.0 ([#4960](#4960))

### Exporter

* Add match by name to more exported resources ([#4939](#4939))
* Improve handling of new dependencies in jobs, pipelines, model serving ([#4914](#4914))
* Add support for `databricks_budget` ([#4957](#4957))
* Correct support for `library.glob` in `databricks_pipeline` ([#4937](#4937))
* Resolve references also for map values ([#4944](#4944))

### Internal Changes

* Replaced `common.APIErrorBody` with corresponding structs in Go SDK ([#4936](#4936))
* Reimplement `databricks_group` data source to use combination of List + Get API ([#4947](#4947))
* Use databricks_sql_table Instead of databricks_table in Sharing Tests ([#4981](#4981)
* Bump the Go SDK to v0.82.0 ([#4986](#4986)).
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.

4 participants