- Team separation: Give each team its own namespace to manage their sources and validators independently.
- Environment isolation: Use separate namespaces for development, staging, and production.
- IaC management: Assign a dedicated namespace to resources deployed through Infrastructure-as-Code to prevent conflicts with manually created resources.
Specify a namespace
When using the CLI or SDK, you can target a specific namespace in two ways:- Per request: Pass the
-nor--namespaceflag with CLI commands, or include the namespace in your API request. - Default namespace: Configure a default using
validio config ns <namespace>(CLI) or setdefault_namespacein yourValidioConfig(SDK).
Manage namespaces with the CLI
Create a namespace and assign members or API keys with roles:Bash
The API key that is used when creating the namespace is added as
ADMIN by default.API keys and namespaces
An API key has a global role, similar to the global role for users, that determines access rights for non-namespaced resources such as users, namespaces, and tags. How an API key gains access to a namespace depends on where the namespace was created:- Created with the CLI: If an API key has the global role
Adminand you use it with the Validio CLI to create a namespace, that API key is automatically added to the namespace with theAdminrole. - Created in the UI: If you create an API key in the UI, you must manually add it to each namespace that it needs to access. See Add API keys to a namespace.
The default namespace
Resources created in the Validio UI are assigned to the namespacedefault. To avoid conflicts, don’t use this namespace in your Validio Code (IaC) projects. To bring resources created in the UI under IaC management, import them out of default instead. See Import resources.