diff --git a/docs/data-sources/acl.md b/docs/data-sources/acl.md index 2c4dcbd5..c6772f13 100644 --- a/docs/data-sources/acl.md +++ b/docs/data-sources/acl.md @@ -17,5 +17,6 @@ The acl data source gets the Tailscale ACL for a tailnet ### Read-Only +- `hujson` (String) The contents of Tailscale ACL as a HuJSON string - `id` (String) The ID of this resource. -- `json` (String) The contents of Tailscale ACL as JSON +- `json` (String) The contents of Tailscale ACL as a JSON string diff --git a/docs/resources/acl.md b/docs/resources/acl.md index 1d069c7d..cc630cb8 100644 --- a/docs/resources/acl.md +++ b/docs/resources/acl.md @@ -16,7 +16,7 @@ If tests are defined in the ACL (the top-level "tests" section), ACL validation ## Example Usage ```terraform -resource "tailscale_acl" "sample_acl" { +resource "tailscale_acl" "as_json" { acl = jsonencode({ acls : [ { @@ -24,9 +24,26 @@ resource "tailscale_acl" "sample_acl" { action = "accept", users = ["*"], ports = ["*:*"], - }], + } + ], }) } + +resource "tailscale_acl" "as_hujson" { + acl = < @@ -34,7 +51,7 @@ resource "tailscale_acl" "sample_acl" { ### Required -- `acl` (String) The JSON-based policy that defines which devices and users are allowed to connect in your network +- `acl` (String) The policy that defines which devices and users are allowed to connect in your network. Can be either a JSON or a HuJSON string. ### Optional diff --git a/examples/resources/tailscale_acl/resource.tf b/examples/resources/tailscale_acl/resource.tf index 0dd35094..d7a2e1f9 100644 --- a/examples/resources/tailscale_acl/resource.tf +++ b/examples/resources/tailscale_acl/resource.tf @@ -1,4 +1,4 @@ -resource "tailscale_acl" "sample_acl" { +resource "tailscale_acl" "as_json" { acl = jsonencode({ acls : [ { @@ -6,6 +6,23 @@ resource "tailscale_acl" "sample_acl" { action = "accept", users = ["*"], ports = ["*:*"], - }], + } + ], }) } + +resource "tailscale_acl" "as_hujson" { + acl = <