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

{{#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~}}