From fcfdc50f3eb9cf7d2f1f774b753d7f114b769e39 Mon Sep 17 00:00:00 2001 From: David Symonds Date: Sun, 28 Jan 2024 20:32:00 +1100 Subject: [PATCH] Document that ACL tests are run when creating and updating tailscale_acl resources. Fixes #158. Closes #161. --- docs/resources/acl.md | 3 +++ tailscale/resource_acl.go | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/resources/acl.md b/docs/resources/acl.md index 21750aa7..787d8998 100644 --- a/docs/resources/acl.md +++ b/docs/resources/acl.md @@ -4,12 +4,15 @@ page_title: "tailscale_acl Resource - terraform-provider-tailscale" subcategory: "" description: |- The acl resource allows you to configure a Tailscale ACL. See https://tailscale.com/kb/1018/acls for more information. Note that this resource will completely overwrite existing ACL contents for a given tailnet. + If tests are defined in the ACL (the top-level "tests" section), ACL validation will occur before creation and update operations are applied. --- # tailscale_acl (Resource) The acl resource allows you to configure a Tailscale ACL. See https://tailscale.com/kb/1018/acls for more information. Note that this resource will completely overwrite existing ACL contents for a given tailnet. +If tests are defined in the ACL (the top-level "tests" section), ACL validation will occur before creation and update operations are applied. + ## Example Usage ```terraform diff --git a/tailscale/resource_acl.go b/tailscale/resource_acl.go index 5009b52f..0e48f51a 100644 --- a/tailscale/resource_acl.go +++ b/tailscale/resource_acl.go @@ -17,9 +17,13 @@ import ( "github.com/tailscale/tailscale-client-go/tailscale" ) +const resourceACLDescription = `The acl resource allows you to configure a Tailscale ACL. See https://tailscale.com/kb/1018/acls for more information. Note that this resource will completely overwrite existing ACL contents for a given tailnet. + +If tests are defined in the ACL (the top-level "tests" section), ACL validation will occur before creation and update operations are applied.` + func resourceACL() *schema.Resource { return &schema.Resource{ - Description: "The acl resource allows you to configure a Tailscale ACL. See https://tailscale.com/kb/1018/acls for more information. Note that this resource will completely overwrite existing ACL contents for a given tailnet.", + Description: resourceACLDescription, ReadContext: resourceACLRead, CreateContext: resourceACLCreate, UpdateContext: resourceACLUpdate,