1. Packages
  2. FusionAuth
  3. API Docs
  4. getTenant
FusionAuth v5.1.0 published on Tuesday, Oct 22, 2024 by Theo Gravity

fusionauth.getTenant

Explore with Pulumi AI

fusionauth logo
FusionAuth v5.1.0 published on Tuesday, Oct 22, 2024 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",
    });
    
    import pulumi
    import pulumi_fusionauth as fusionauth
    
    default = fusionauth.get_tenant(name="Default")
    
    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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: fusionauth:getTenant
          Arguments:
            name: Default
    

    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>
    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]
    func GetTenant(ctx *Context, args *GetTenantArgs, opts ...InvokeOption) (*GetTenantResult, error)
    func GetTenantOutput(ctx *Context, args *GetTenantOutputArgs, opts ...InvokeOption) GetTenantResultOutput

    > 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)
    }
    public static CompletableFuture<GetTenantResult> getTenant(GetTenantArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: fusionauth:index/getTenant:getTenant
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Tenant.
    Name string
    The name of the Tenant.
    name String
    The name of the Tenant.
    name string
    The name of the Tenant.
    name str
    The name of the Tenant.
    name 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 logo
    FusionAuth v5.1.0 published on Tuesday, Oct 22, 2024 by Theo Gravity