1. Packages
  2. Volcengine
  3. API Docs
  4. organization
  5. Unit
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.organization.Unit

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    Provides a resource to manage organization unit

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooOrganization = new Volcengine.Organization.Organization("fooOrganization");
    
        var fooUnits = Volcengine.Organization.Units.Invoke();
    
        var fooUnit = new Volcengine.Organization.Unit("fooUnit", new()
        {
            ParentId = .Where(unit => unit.ParentId == "0").Select(unit => 
            {
                return  unit.Id;
            })[0],
            Description = "tf-test",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/organization"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organization.NewOrganization(ctx, "fooOrganization", nil)
    		if err != nil {
    			return err
    		}
    		fooUnits, err := organization.Units(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = organization.NewUnit(ctx, "fooUnit", &organization.UnitArgs{
    			ParentId:    "TODO: For expression"[0],
    			Description: pulumi.String("tf-test"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_organization = volcengine.organization.Organization("fooOrganization")
    foo_units = volcengine.organization.units()
    foo_unit = volcengine.organization.Unit("fooUnit",
        parent_id=[unit.id for unit in foo_units.units if unit.parent_id == "0"][0],
        description="tf-test")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooOrganization = new volcengine.organization.Organization("fooOrganization", {});
    const fooUnits = volcengine.organization.Units({});
    const fooUnit = new volcengine.organization.Unit("fooUnit", {
        parentId: fooUnits.then(fooUnits => .filter(unit => unit.parentId == "0").map(unit => (unit.id))[0]),
        description: "tf-test",
    });
    

    Coming soon!

    Create Unit Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Unit(name: string, args: UnitArgs, opts?: CustomResourceOptions);
    @overload
    def Unit(resource_name: str,
             args: UnitArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Unit(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             parent_id: Optional[str] = None,
             description: Optional[str] = None,
             name: Optional[str] = None)
    func NewUnit(ctx *Context, name string, args UnitArgs, opts ...ResourceOption) (*Unit, error)
    public Unit(string name, UnitArgs args, CustomResourceOptions? opts = null)
    public Unit(String name, UnitArgs args)
    public Unit(String name, UnitArgs args, CustomResourceOptions options)
    
    type: volcengine:organization:Unit
    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 UnitArgs
    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 UnitArgs
    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 UnitArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UnitArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UnitArgs
    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 unitResource = new Volcengine.Organization.Unit("unitResource", new()
    {
        ParentId = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := organization.NewUnit(ctx, "unitResource", &organization.UnitArgs{
    	ParentId:    pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var unitResource = new Unit("unitResource", UnitArgs.builder()
        .parentId("string")
        .description("string")
        .name("string")
        .build());
    
    unit_resource = volcengine.organization.Unit("unitResource",
        parent_id="string",
        description="string",
        name="string")
    
    const unitResource = new volcengine.organization.Unit("unitResource", {
        parentId: "string",
        description: "string",
        name: "string",
    });
    
    type: volcengine:organization:Unit
    properties:
        description: string
        name: string
        parentId: string
    

    Unit 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 Unit resource accepts the following input properties:

    ParentId string
    Parent Organization Unit ID.
    Description string
    Description of the organization unit.
    Name string
    Name of the organization unit.
    ParentId string
    Parent Organization Unit ID.
    Description string
    Description of the organization unit.
    Name string
    Name of the organization unit.
    parentId String
    Parent Organization Unit ID.
    description String
    Description of the organization unit.
    name String
    Name of the organization unit.
    parentId string
    Parent Organization Unit ID.
    description string
    Description of the organization unit.
    name string
    Name of the organization unit.
    parent_id str
    Parent Organization Unit ID.
    description str
    Description of the organization unit.
    name str
    Name of the organization unit.
    parentId String
    Parent Organization Unit ID.
    description String
    Description of the organization unit.
    name String
    Name of the organization unit.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Unit resource produces the following output properties:

    Depth int
    The depth of the organization unit.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId string
    The id of the organization.
    OrgType int
    The organization type.
    Owner string
    The owner of the organization unit.
    Depth int
    The depth of the organization unit.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId string
    The id of the organization.
    OrgType int
    The organization type.
    Owner string
    The owner of the organization unit.
    depth Integer
    The depth of the organization unit.
    id String
    The provider-assigned unique ID for this managed resource.
    orgId String
    The id of the organization.
    orgType Integer
    The organization type.
    owner String
    The owner of the organization unit.
    depth number
    The depth of the organization unit.
    id string
    The provider-assigned unique ID for this managed resource.
    orgId string
    The id of the organization.
    orgType number
    The organization type.
    owner string
    The owner of the organization unit.
    depth int
    The depth of the organization unit.
    id str
    The provider-assigned unique ID for this managed resource.
    org_id str
    The id of the organization.
    org_type int
    The organization type.
    owner str
    The owner of the organization unit.
    depth Number
    The depth of the organization unit.
    id String
    The provider-assigned unique ID for this managed resource.
    orgId String
    The id of the organization.
    orgType Number
    The organization type.
    owner String
    The owner of the organization unit.

    Look up Existing Unit Resource

    Get an existing Unit 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?: UnitState, opts?: CustomResourceOptions): Unit
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            depth: Optional[int] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            org_type: Optional[int] = None,
            owner: Optional[str] = None,
            parent_id: Optional[str] = None) -> Unit
    func GetUnit(ctx *Context, name string, id IDInput, state *UnitState, opts ...ResourceOption) (*Unit, error)
    public static Unit Get(string name, Input<string> id, UnitState? state, CustomResourceOptions? opts = null)
    public static Unit get(String name, Output<String> id, UnitState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Depth int
    The depth of the organization unit.
    Description string
    Description of the organization unit.
    Name string
    Name of the organization unit.
    OrgId string
    The id of the organization.
    OrgType int
    The organization type.
    Owner string
    The owner of the organization unit.
    ParentId string
    Parent Organization Unit ID.
    Depth int
    The depth of the organization unit.
    Description string
    Description of the organization unit.
    Name string
    Name of the organization unit.
    OrgId string
    The id of the organization.
    OrgType int
    The organization type.
    Owner string
    The owner of the organization unit.
    ParentId string
    Parent Organization Unit ID.
    depth Integer
    The depth of the organization unit.
    description String
    Description of the organization unit.
    name String
    Name of the organization unit.
    orgId String
    The id of the organization.
    orgType Integer
    The organization type.
    owner String
    The owner of the organization unit.
    parentId String
    Parent Organization Unit ID.
    depth number
    The depth of the organization unit.
    description string
    Description of the organization unit.
    name string
    Name of the organization unit.
    orgId string
    The id of the organization.
    orgType number
    The organization type.
    owner string
    The owner of the organization unit.
    parentId string
    Parent Organization Unit ID.
    depth int
    The depth of the organization unit.
    description str
    Description of the organization unit.
    name str
    Name of the organization unit.
    org_id str
    The id of the organization.
    org_type int
    The organization type.
    owner str
    The owner of the organization unit.
    parent_id str
    Parent Organization Unit ID.
    depth Number
    The depth of the organization unit.
    description String
    Description of the organization unit.
    name String
    Name of the organization unit.
    orgId String
    The id of the organization.
    orgType Number
    The organization type.
    owner String
    The owner of the organization unit.
    parentId String
    Parent Organization Unit ID.

    Import

    OrganizationUnit can be imported using the id, e.g.

     $ pulumi import volcengine:organization/unit:Unit default ID
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine