Skip to content

Commit 00eac36

Browse files
authored
[Doc] Update documentation for importing some MWS resources (#4281)
## Changes Some resources are documented as not being importable, but some actually are. This PR adds docs to a few that I was able to test out myself. ## Tests Imported existing resources into a local TF project, which worked.
1 parent 448f866 commit 00eac36

File tree

5 files changed

+44
-5
lines changed

5 files changed

+44
-5
lines changed

docs/resources/mws_customer_managed_keys.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,15 @@ In addition to all arguments above, the following attributes are exported:
253253

254254
## Import
255255

256-
!> Importing this resource is not currently supported.
256+
This resource can be imported by Databricks account ID and customer managed key ID.
257+
258+
```sh
259+
terraform import databricks_mws_customer_managed_keys.this '<account_id>/<customer_managed_key_id>'
260+
```
261+
262+
~> This resource does not support updates. If your configuration does not match the existing resource,
263+
the next `terraform apply` will cause the resource to be destroyed and recreated. After importing,
264+
verify that the configuration matches the existing resource by running `terraform plan`.
257265

258266
## Related Resources
259267

docs/resources/mws_networks.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,15 @@ In addition to all arguments above, the following attributes are exported:
215215

216216
## Import
217217

218-
!> Importing this resource is not currently supported.
218+
This resource can be imported by Databricks account ID and network ID.
219+
220+
```sh
221+
terraform import databricks_mws_networks.this '<account_id>/<network_id>'
222+
```
223+
224+
~> This resource does not support updates. If your configuration does not match the existing resource,
225+
the next `terraform apply` will cause the resource to be destroyed and recreated. After importing,
226+
verify that the configuration matches the existing resource by running `terraform plan`.
219227

220228
## Related Resources
221229

docs/resources/mws_private_access_settings.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ In addition to all arguments above, the following attributes are exported:
8585

8686
## Import
8787

88-
!> Importing this resource is not currently supported.
88+
This resource can be imported by Databricks account ID and private access settings ID.
89+
90+
```sh
91+
terraform import databricks_mws_private_access_settings.this '<account_id>/<private_access_settings_id>'
92+
```
8993

9094
## Related Resources
9195

docs/resources/mws_storage_configurations.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ In addition to all arguments above, the following attributes are exported:
5555

5656
## Import
5757

58-
!> Importing this resource is not currently supported.
58+
This resource can be imported by Databricks account ID and storage configuration ID.
59+
60+
```sh
61+
terraform import databricks_mws_storage_configurations.this '<account_id>/<storage_configuration_id>'
62+
```
63+
64+
~> This resource does not support updates. If your configuration does not match the existing resource,
65+
the next `terraform apply` will cause the resource to be destroyed and recreated. After importing,
66+
verify that the configuration matches the existing resource by running `terraform plan`.
5967

6068
## Related Resources
6169

docs/resources/mws_workspaces.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,18 @@ You can reset local DNS caches before provisioning new workspaces with one of th
392392

393393
## Import
394394

395-
!> Importing this resource is not currently supported.
395+
This resource can be imported by Databricks account ID and workspace ID.
396+
397+
```sh
398+
terraform import databricks_mws_networks.this '<account_id>/<workspace_id>'
399+
```
400+
401+
~> Not all fields of `databricks_mws_workspaces` can be updated without causing the workspace to be recreated.
402+
If the configuration for these immutable fields does not match the existing workspace, the workspace will
403+
be deleted and recreated in the next `terraform apply`. After importing, verify that the configuration
404+
matches the existing resource by running `terraform plan`. The only fields that can be updated are
405+
`credentials_id`, `network_id`, `storage_customer_managed_key_id`, `private_access_settings_id`,
406+
`managed_services_customer_managed_key_id`, and `custom_tags`.
396407

397408
## Related Resources
398409

0 commit comments

Comments
 (0)