Skip to content

Commit

Permalink
[Doc] Update documentation for importing some MWS resources (#4281)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
mgyucht authored Nov 29, 2024
1 parent 448f866 commit 00eac36
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 5 deletions.
10 changes: 9 additions & 1 deletion docs/resources/mws_customer_managed_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,15 @@ In addition to all arguments above, the following attributes are exported:

## Import

!> Importing this resource is not currently supported.
This resource can be imported by Databricks account ID and customer managed key ID.

```sh
terraform import databricks_mws_customer_managed_keys.this '<account_id>/<customer_managed_key_id>'
```

~> This resource does not support updates. If your configuration does not match the existing resource,
the next `terraform apply` will cause the resource to be destroyed and recreated. After importing,
verify that the configuration matches the existing resource by running `terraform plan`.

## Related Resources

Expand Down
10 changes: 9 additions & 1 deletion docs/resources/mws_networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,15 @@ In addition to all arguments above, the following attributes are exported:

## Import

!> Importing this resource is not currently supported.
This resource can be imported by Databricks account ID and network ID.

```sh
terraform import databricks_mws_networks.this '<account_id>/<network_id>'
```

~> This resource does not support updates. If your configuration does not match the existing resource,
the next `terraform apply` will cause the resource to be destroyed and recreated. After importing,
verify that the configuration matches the existing resource by running `terraform plan`.

## Related Resources

Expand Down
6 changes: 5 additions & 1 deletion docs/resources/mws_private_access_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ In addition to all arguments above, the following attributes are exported:

## Import

!> Importing this resource is not currently supported.
This resource can be imported by Databricks account ID and private access settings ID.

```sh
terraform import databricks_mws_private_access_settings.this '<account_id>/<private_access_settings_id>'
```

## Related Resources

Expand Down
10 changes: 9 additions & 1 deletion docs/resources/mws_storage_configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,15 @@ In addition to all arguments above, the following attributes are exported:

## Import

!> Importing this resource is not currently supported.
This resource can be imported by Databricks account ID and storage configuration ID.

```sh
terraform import databricks_mws_storage_configurations.this '<account_id>/<storage_configuration_id>'
```

~> This resource does not support updates. If your configuration does not match the existing resource,
the next `terraform apply` will cause the resource to be destroyed and recreated. After importing,
verify that the configuration matches the existing resource by running `terraform plan`.

## Related Resources

Expand Down
13 changes: 12 additions & 1 deletion docs/resources/mws_workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,18 @@ You can reset local DNS caches before provisioning new workspaces with one of th

## Import

!> Importing this resource is not currently supported.
This resource can be imported by Databricks account ID and workspace ID.

```sh
terraform import databricks_mws_networks.this '<account_id>/<workspace_id>'
```

~> Not all fields of `databricks_mws_workspaces` can be updated without causing the workspace to be recreated.
If the configuration for these immutable fields does not match the existing workspace, the workspace will
be deleted and recreated in the next `terraform apply`. After importing, verify that the configuration
matches the existing resource by running `terraform plan`. The only fields that can be updated are
`credentials_id`, `network_id`, `storage_customer_managed_key_id`, `private_access_settings_id`,
`managed_services_customer_managed_key_id`, and `custom_tags`.

## Related Resources

Expand Down

0 comments on commit 00eac36

Please sign in to comment.