Skip to main content

Tenant lifecycle

Available

Deployed and supported. The fields and commands described here are stable within version v1alpha1.

A tenant is created with one command and destroyed with another. In between, it lives its life: policies, manifests, a tier. This page describes each step and what you get.

Create​

sng tenant create acme

The CLI confirms the creation and tells you what to do next:

next: sng tenant use acme

Conditions:

  • you are signed in (sng sso login) with a StackNGO account;
  • the name follows the naming rule and is neither reserved nor already taken (409 conflict).

What you get: an isolated tenant, in tier 3XS, with its default policies, of which you are administrator (assume-role and admin), and its subdomain acme.dev.stackngo.app. Allow one to two minutes before it is usable.

The first minutes​

As long as the tenant is not ready, any attempt to open a session responds 409 policies_pending with Retry-After: 10. sng tenant use handles the wait:

sng tenant use acme
waiting for the tenant default policies…
current tenant: acme

If the wait exceeds six minutes, the CLI gives up: try again, and if it persists, contact support with the tenant name.

Users of your applications (optional)​

The directory of your end users' accounts and sign-in to your applications are available as soon as the tenant is created, with no activation step (Users of your applications). It is not needed to deploy: if you have no end users to manage, ignore this section.

Give other people access​

Access is made of policies attached to identities. For a colleague to be able to work on the tenant, they need at least assume-role (open a session) and a policy that describes their rights:

sng tenant policy attach assume-role --user bob
sng tenant policy attach readwrite --user bob

readonly, readwrite and admin cover the common cases; custom policies are possible (Policies). For a CI, prefer an OIDC trust; for a machine, a machine application.

Work on several tenants​

sng tenant list
sng tenant use labs # changes the current tenant
sng tenant assume labs # temporary session, without changing the current tenant

sng tenant list shows the tenants where you hold a policy, directly or through a role. assume requires iam:AssumeRole on the target tenant, declared in that tenant.

Change payer or stop paying​

The payer of a tenant is the account that pays for it: its creator at first. A tenant administrator can invite another account to take over billing, from the console or with sng tenant billing set acme jane@example.com; the payer changes only once the invitation is accepted, and the tenant then counts towards the new payer's tenant limit.

The payer can also stop paying at any time, from the console, by typing the name of the tenant to confirm:

  • if the creator of the tenant is still a member and has room left in their tenant limit, they take over billing;
  • otherwise the tenant enters a 7-day notice: it stays usable, its administrators are notified by e-mail (and again the day before the deadline), and it is deleted with its data at the end of the notice. To keep it, an administrator invites an account to take over billing: as soon as that account accepts, the notice is lifted.

Change tier​

See Tiers and quotas. Moving up is immediate; moving down requires that consumption fits.

Destroy​

sng tenant destroy acme
⚠ Suppression définitive du tenant "acme".
Tapez « oui » pour confirmer : oui

Conditions: a session on this tenant with iam:admin (policy admin). You cannot destroy a tenant from the session of another tenant, nor the StackNGO organization.

What disappears: everything the tenant contains (applications, volumes, certificates), the desired state, the policies, the identity organization and its users, the tenant's image repositories. Secrets are deleted and cannot be restored (Versions and restore); a brought domain becomes available again for another tenant once the zone is deleted.

Irreversible

There is no tenant recycle bin. First export what you want to keep: sng pull for the manifests, sng secret get for the values you could not regenerate.

Environments and restore​

The platform keeps the history of what you apply: you can go back to a frozen version (sng env restore <ref>) or create a tenant from the state of another one (sng env create-tenant <name> [ref]). See Environments and restore.

If it doesn't work​

MessageCauseFix
invalid organization: …Invalid or reserved nameSee Tenant names
409 conflictThe name is already takenChoose another one
policies_pending after six minutes of waitingThe tenant is still not readyRetry; if it persists, contact support with the tenant name
forbidden (…) on sng tenant destroyThe session is not on this tenant, or does not have iam:adminsng tenant use <tenant> with an administrator account

See also​