Skip to content

Commit

Permalink
Support importing tailscale_dns_preferences resources.
Browse files Browse the repository at this point in the history
Also document importing tailscale_acl resources, which was supported
from #186.
  • Loading branch information
dsymonds committed Oct 22, 2023
1 parent 37977ca commit 948a95d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/resources/acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ resource "tailscale_acl" "sample_acl" {
### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
# ID doesn't matter.
terraform import tailscale_acl.sample_acl acl
```
9 changes: 9 additions & 0 deletions docs/resources/dns_preferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ resource "tailscale_dns_preferences" "sample_preferences" {
### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
# ID doesn't matter.
terraform import tailscale_dns_preferences.sample_preferences dns_preferences
```
1 change: 1 addition & 0 deletions examples/resources/tailscale_acl/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import tailscale_acl.sample_acl acl
1 change: 1 addition & 0 deletions examples/resources/tailscale_dns_preferences/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import tailscale_dns_preferences.sample_preferences dns_preferences
3 changes: 3 additions & 0 deletions tailscale/resource_dns_preferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func resourceDNSPreferences() *schema.Resource {
CreateContext: resourceDNSPreferencesCreate,
UpdateContext: resourceDNSPreferencesUpdate,
DeleteContext: resourceDNSPreferencesDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Schema: map[string]*schema.Schema{
"magic_dns": {
Type: schema.TypeBool,
Expand Down

0 comments on commit 948a95d

Please sign in to comment.