Skip to content

Commit

Permalink
Update ACL examples to use jsonencode (#38)
Browse files Browse the repository at this point in the history
This commit modifies the example/documentation for ACLs to use the `jsonencode` function
instead of heredocs.

Closes #36

Signed-off-by: David Bond <[email protected]>
  • Loading branch information
davidsbond committed Aug 30, 2021
1 parent b2fa62c commit 686f6c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
20 changes: 9 additions & 11 deletions docs/resources/acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ for more information.

```terraform
resource "tailscale_acl" "sample_acl" {
acl = <<EOF
{
"acls": [
{
"action": "accept",
"users": ["*"],
"ports": ["*:*"]
}
]
}
EOF
acl = jsonencode({
acls : [
{
// Allow all users access to all ports.
action = "accept",
users = ["*"],
ports = ["*:*"],
}],
})
}
```

Expand Down
20 changes: 9 additions & 11 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ provider "tailscale" {
}

resource "tailscale_acl" "sample_acl" {
acl = <<EOF
{
"acls": [
{
"action": "accept",
"users": ["*"],
"ports": ["*:*"]
}
]
}
EOF
acl = jsonencode({
acls : [
{
// Allow all users access to all ports.
action = "accept",
users = ["*"],
ports = ["*:*"],
}],
})
}


Expand Down

0 comments on commit 686f6c9

Please sign in to comment.