netbox.Tenant
Explore with Pulumi AI
From the official documentation:
A tenant represents a discrete grouping of resources used for administrative purposes. Typically, tenants are used to represent individual customers or internal departments within an organization.
Tenant assignment is used to signify the ownership of an object in NetBox. As such, each object may only be owned by a single tenant. For example, if you have a firewall dedicated to a particular customer, you would assign it to the tenant which represents that customer. However, if the firewall serves multiple customers, it doesn’t belong to any particular customer, so tenant assignment would not be appropriate.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const customerA = new netbox.Tenant("customerA", {});
import pulumi
import pulumi_netbox as netbox
customer_a = netbox.Tenant("customerA")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := netbox.NewTenant(ctx, "customerA", nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var customerA = new Netbox.Tenant("customerA");
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Tenant;
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) {
var customerA = new Tenant("customerA");
}
}
resources:
customerA:
type: netbox:Tenant
Create Tenant Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Tenant(name: string, args?: TenantArgs, opts?: CustomResourceOptions);
@overload
def Tenant(resource_name: str,
args: Optional[TenantArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Tenant(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
group_id: Optional[float] = None,
name: Optional[str] = None,
slug: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[str] = None)
func NewTenant(ctx *Context, name string, args *TenantArgs, opts ...ResourceOption) (*Tenant, error)
public Tenant(string name, TenantArgs? args = null, CustomResourceOptions? opts = null)
public Tenant(String name, TenantArgs args)
public Tenant(String name, TenantArgs args, CustomResourceOptions options)
type: netbox:Tenant
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TenantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TenantArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TenantArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TenantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TenantArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var tenantResource = new Netbox.Tenant("tenantResource", new()
{
Description = "string",
GroupId = 0,
Name = "string",
Slug = "string",
Tags = new[]
{
"string",
},
TenantId = "string",
});
example, err := netbox.NewTenant(ctx, "tenantResource", &netbox.TenantArgs{
Description: pulumi.String("string"),
GroupId: pulumi.Float64(0),
Name: pulumi.String("string"),
Slug: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
TenantId: pulumi.String("string"),
})
var tenantResource = new Tenant("tenantResource", TenantArgs.builder()
.description("string")
.groupId(0)
.name("string")
.slug("string")
.tags("string")
.tenantId("string")
.build());
tenant_resource = netbox.Tenant("tenantResource",
description="string",
group_id=0,
name="string",
slug="string",
tags=["string"],
tenant_id="string")
const tenantResource = new netbox.Tenant("tenantResource", {
description: "string",
groupId: 0,
name: "string",
slug: "string",
tags: ["string"],
tenantId: "string",
});
type: netbox:Tenant
properties:
description: string
groupId: 0
name: string
slug: string
tags:
- string
tenantId: string
Tenant Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Tenant resource accepts the following input properties:
- Description string
- Group
Id double - Name string
- Slug string
- List<string>
- Tenant
Id string - The ID of this resource.
- Description string
- Group
Id float64 - Name string
- Slug string
- []string
- Tenant
Id string - The ID of this resource.
- description String
- group
Id Double - name String
- slug String
- List<String>
- tenant
Id String - The ID of this resource.
- description string
- group
Id number - name string
- slug string
- string[]
- tenant
Id string - The ID of this resource.
- description str
- group_
id float - name str
- slug str
- Sequence[str]
- tenant_
id str - The ID of this resource.
- description String
- group
Id Number - name String
- slug String
- List<String>
- tenant
Id String - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Tenant resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Tenant Resource
Get an existing Tenant resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TenantState, opts?: CustomResourceOptions): Tenant
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
group_id: Optional[float] = None,
name: Optional[str] = None,
slug: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[str] = None) -> Tenant
func GetTenant(ctx *Context, name string, id IDInput, state *TenantState, opts ...ResourceOption) (*Tenant, error)
public static Tenant Get(string name, Input<string> id, TenantState? state, CustomResourceOptions? opts = null)
public static Tenant get(String name, Output<String> id, TenantState state, CustomResourceOptions options)
resources: _: type: netbox:Tenant get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
- Group
Id double - Name string
- Slug string
- List<string>
- Tenant
Id string - The ID of this resource.
- Description string
- Group
Id float64 - Name string
- Slug string
- []string
- Tenant
Id string - The ID of this resource.
- description String
- group
Id Double - name String
- slug String
- List<String>
- tenant
Id String - The ID of this resource.
- description string
- group
Id number - name string
- slug string
- string[]
- tenant
Id string - The ID of this resource.
- description str
- group_
id float - name str
- slug str
- Sequence[str]
- tenant_
id str - The ID of this resource.
- description String
- group
Id Number - name String
- slug String
- List<String>
- tenant
Id String - The ID of this resource.
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.