Difference between revisions of "Terraform resource: tailscale acl"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
  
 
== Official example ==
 
== Official example ==
<pre>
+
 
resource "tailscale_acl" "as_json" {
+
resource "tailscale_acl" "as_json" {
   acl = jsonencode({
+
   acl = [[jsonencode]]({
 
     acls : [
 
     acls : [
 
       {
 
       {
Line 14: Line 14:
 
     ],
 
     ],
 
   })
 
   })
}
+
}
  
 +
<pre>
 
resource "tailscale_acl" "as_hujson" {
 
resource "tailscale_acl" "as_hujson" {
 
   acl = <<EOF
 
   acl = <<EOF

Revision as of 15:15, 18 July 2024

Official example

resource "tailscale_acl" "as_json" {
 acl = jsonencode({
   acls : [
     {
       // Allow all users access to all ports.
       action = "accept",
       users  = ["*"],
       ports  = ["*:*"],
     },
   ],
 })
}
resource "tailscale_acl" "as_hujson" {
  acl = <<EOF
  {
    // Comments in HuJSON policy are preserved when the policy is applied.
    "acls": [
      {
        // Allow all users access to all ports.
        action = "accept",
        users  = ["*"],
        ports  = ["*:*"],
      },
    ],
  }
  EOF
}

See also

Advertising: