{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
}}

{{#if (can "use partitions")~}}
partition "{{or @partition 'default'}}" {
  {{#if (can "use nspaces")}}
  namespace "default" {
    node "{{@name}}" {
	    policy = "write"
    }
  }
  namespace_prefix "" {
    service_prefix "" {
	    policy = "read"
    }
  }
  {{else}}
  node "{{@name}}" {
	  policy = "write"
  }
  service_prefix "" {
	  policy = "read"
  }
  {{/if}}
}
{{~else~}}
{{~#if (can "use nspaces")~}}
namespace "default" {
  node "{{@name}}" {
	  policy = "write"
  }
}
namespace_prefix "" {
  service_prefix "" {
	  policy = "read"
  }
}
{{else}}
node "{{@name}}" {
	policy = "write"
}
service_prefix "" {
	policy = "read"
}
{{~/if~}}
{{~/if~}}