1. Packages
  2. Volcengine
  3. API Docs
  4. organization
  5. Unit
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.organization.Unit

Explore with Pulumi AI

Provides a resource to manage organization unit

Example Usage

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",
});
Copy
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")
Copy
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
	})
}
Copy
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;
        }).ToList()[0],
        Description = "tf-test",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.organization.Organization;
import com.pulumi.volcengine.organization.OrganizationFunctions;
import com.pulumi.volcengine.organization.inputs.UnitsArgs;
import com.pulumi.volcengine.organization.Unit;
import com.pulumi.volcengine.organization.UnitArgs;
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 fooOrganization = new Organization("fooOrganization");

        final var fooUnits = OrganizationFunctions.Units();

        var fooUnit = new Unit("fooUnit", UnitArgs.builder()        
            .parentId("TODO: ForExpression"[0])
            .description("tf-test")
            .build());

    }
}
Copy
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 This property is required. string
The unique name of the resource.
args This property is required. UnitArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. UnitArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UnitArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
example, err := organization.NewUnit(ctx, "unitResource", &organization.UnitArgs{
	ParentId:    pulumi.String("string"),
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
})
Copy
var unitResource = new Unit("unitResource", UnitArgs.builder()
    .parentId("string")
    .description("string")
    .name("string")
    .build());
Copy
unit_resource = volcengine.organization.Unit("unitResource",
    parent_id="string",
    description="string",
    name="string")
Copy
const unitResource = new volcengine.organization.Unit("unitResource", {
    parentId: "string",
    description: "string",
    name: "string",
});
Copy
type: volcengine:organization:Unit
properties:
    description: string
    name: string
    parentId: string
Copy

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
This property is required.
Changes to this property will trigger replacement.
string
Parent Organization Unit ID.
Description string
Description of the organization unit.
Name string
Name of the organization unit.
ParentId
This property is required.
Changes to this property will trigger replacement.
string
Parent Organization Unit ID.
Description string
Description of the organization unit.
Name string
Name of the organization unit.
parentId
This property is required.
Changes to this property will trigger replacement.
String
Parent Organization Unit ID.
description String
Description of the organization unit.
name String
Name of the organization unit.
parentId
This property is required.
Changes to this property will trigger replacement.
string
Parent Organization Unit ID.
description string
Description of the organization unit.
name string
Name of the organization unit.
parent_id
This property is required.
Changes to this property will trigger replacement.
str
Parent Organization Unit ID.
description str
Description of the organization unit.
name str
Name of the organization unit.
parentId
This property is required.
Changes to this property will trigger replacement.
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)
resources:  _:    type: volcengine:organization:Unit    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
Parent Organization Unit ID.

Import

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

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

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.