Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview
On this page

luna tenants

Add, list and delete the tenants of an environment, and the host names a tenant answers on.

luna tenants adds tenants to an environment. Each runs the environment’s code with data of its own.

luna tenants create acme

Reference

luna tenants <COMMAND>

Every subcommand acts on one environment, and takes these options.

Option Type Default Does
--dir <DIR> path . The app’s folder. Its env file names the project and environment.
--env <ENV> text LUNA_ENV, then production The environment, by name.
--project <PROJECT> text LUNA_PROJECT The project, by name or as organisation/project.
--token <TOKEN> text LUNA_TOKEN, then your login An API token or account key to act with.

luna tenants list

Lists the environment’s tenants: its own, named default, and every one added. Each row has its version, URL and labels.

luna tenants list [OPTIONS]
Option Type Default Does
--json flag Off Prints the answer as JSON.

luna tenants create

Adds a tenant to the environment, and prints its URL.

luna tenants create [OPTIONS] <NAME>
Option Type Default Does
<NAME> text Required The tenant’s name: lowercase letters, digits and single dashes.
--label <KEY=VALUE> text None A label to find the tenant by. Repeat it for more labels.

luna tenants delete

Deletes a tenant added to the environment, with all its data.

luna tenants delete [OPTIONS] <NAME>
Option Type Default Does
<NAME> text Required The tenant, by name. Never default, which is deleted with its environment.
--yes flag Off Deletes it without asking first.

luna tenants hosts

Lists, adds or removes the host names a tenant answers on besides its own URL. With no --add or --remove, it lists them.

luna tenants hosts [OPTIONS]
Option Type Default Does
--tenant <TENANT> text The environment’s own The tenant, by name.
--add <HOST> text None Answers on this host name too. Repeat it for more.
--remove <HOST> text None Stops answering on this host name. Repeat it for more.
--json flag Off Prints the answer as JSON.

A host name is kept in lowercase, without a scheme, port or trailing slash. To serve a domain of your own with a certificate, use luna domains instead.

Good to know

  • Every environment has a default tenant, where your app runs. Most apps never add another.
  • Other commands act on an added tenant when you pass --tenant <NAME>, such as luna secrets set and luna logs.

Examples

Add a tenant with labels

luna tenants create acme --label plan=pro --label region=eu

List the tenants of production

luna tenants list --env production

Delete a tenant from a script

luna tenants delete acme --yes

Was this page helpful?