1. Packages
  2. FusionAuth
  3. API Docs
  4. getTenant
FusionAuth v6.0.2 published on Sunday, Feb 9, 2025 by Theo Gravity

fusionauth.getTenant

Explore with Pulumi AI

FusionAuth v6.0.2 published on Sunday, Feb 9, 2025 by Theo Gravity

# Tenant Resource

A FusionAuth Tenant is a named object that represents a discrete namespace for Users, Applications and Groups. A user is unique by email address or username within a tenant.

Tenants may be useful to support a multi-tenant application where you wish to use a single instance of FusionAuth but require the ability to have duplicate users across the tenants in your own application. In this scenario a user may exist multiple times with the same email address and different passwords across tenants.

Tenants may also be useful in a test or staging environment to allow multiple users to call APIs and create and modify users without possibility of collision.

Tenants API

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as fusionauth from "@pulumi/fusionauth";

const default = fusionauth.getTenant({
    name: "Default",
});
Copy
import pulumi
import pulumi_fusionauth as fusionauth

default = fusionauth.get_tenant(name="Default")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/theogravity/pulumi-fusionauth/sdk/go/fusionauth"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := fusionauth.GetTenant(ctx, &fusionauth.GetTenantArgs{
			Name: "Default",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fusionauth = Pulumi.Fusionauth;

return await Deployment.RunAsync(() => 
{
    var @default = Fusionauth.GetTenant.Invoke(new()
    {
        Name = "Default",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.fusionauth.FusionauthFunctions;
import com.pulumi.fusionauth.inputs.GetTenantArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var default = FusionauthFunctions.getTenant(GetTenantArgs.builder()
            .name("Default")
            .build());

    }
}
Copy
variables:
  default:
    fn::invoke:
      function: fusionauth:getTenant
      arguments:
        name: Default
Copy

Using getTenant

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getTenant(args: GetTenantArgs, opts?: InvokeOptions): Promise<GetTenantResult>
function getTenantOutput(args: GetTenantOutputArgs, opts?: InvokeOptions): Output<GetTenantResult>
Copy
def get_tenant(name: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetTenantResult
def get_tenant_output(name: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetTenantResult]
Copy
func GetTenant(ctx *Context, args *GetTenantArgs, opts ...InvokeOption) (*GetTenantResult, error)
func GetTenantOutput(ctx *Context, args *GetTenantOutputArgs, opts ...InvokeOption) GetTenantResultOutput
Copy

> Note: This function is named GetTenant in the Go SDK.

public static class GetTenant 
{
    public static Task<GetTenantResult> InvokeAsync(GetTenantArgs args, InvokeOptions? opts = null)
    public static Output<GetTenantResult> Invoke(GetTenantInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTenantResult> getTenant(GetTenantArgs args, InvokeOptions options)
public static Output<GetTenantResult> getTenant(GetTenantArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: fusionauth:index/getTenant:getTenant
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name
This property is required.
Changes to this property will trigger replacement.
string
The name of the Tenant.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name of the Tenant.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of the Tenant.
name
This property is required.
Changes to this property will trigger replacement.
string
The name of the Tenant.
name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Tenant.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of the Tenant.

getTenant Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
Id string
The provider-assigned unique ID for this managed resource.
Name string
id String
The provider-assigned unique ID for this managed resource.
name String
id string
The provider-assigned unique ID for this managed resource.
name string
id str
The provider-assigned unique ID for this managed resource.
name str
id String
The provider-assigned unique ID for this managed resource.
name String

Package Details

Repository
fusionauth theogravity/pulumi-fusionauth
License
MIT
Notes
This Pulumi package is based on the fusionauth Terraform Provider.
FusionAuth v6.0.2 published on Sunday, Feb 9, 2025 by Theo Gravity