Hello! Little question how can I create one YAML f...
# community
m
Hello! Little question how can I create one YAML file and add like 2 or 3 endoints for API: right now I have resource: "user" but when I add another resource: "invoice" it fails
c
Hi, I assume you are talking about having more than one policy defined in a single YAML file. We don't support that. Each policy needs to be contained in its own file.
m
and I can put a specific directory for each project like, ERPProject/policies.yaml, CustomerProject/policies.yaml?
a
It might be useful to look at one of our playground instances to see how you can work with multiple files: https://play.cerbos.dev/p/bvcxiZY0610b114aig5k1vsm6YPvO5X8
m
yes I have multiple files, but now I have one cerbos server and multiple projects connected to cerbos with each project having different roles, conditions etc.. so right now I have like 50 files yaml on policies folder I want to split each yaml file on a project path folder, something like that
c
If you want to use a single Cerbos instance and share it between multiple projects, yes, you can organize your policies into sub directories. Just configure Cerbos to use the root directory and it will discover all the policies contained in sub directories under that.
Copy code
cerbos/
├── projectA
│   ├── policy_p.yaml
│   └── policy_q.yaml
└── projectB
    ├── policy_x.yaml
    ├── policy_y.yaml
    └── policy_z.yaml
m
thanks so much
🙌 1
m
@Charith (Cerbos) why is having multiple documents in a single YAML file not supported?
c
m
since using multiple documents in a single yaml file is natural, I suggest this limitation should be documented to avoid confusion
👍 1