1. Packages
  2. AWS Native
  3. API Docs
  4. organizations
  5. OrganizationalUnit

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws-native.organizations.OrganizationalUnit

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi

    You can use organizational units (OUs) to group accounts together to administer as a single unit. This greatly simplifies the management of your accounts. For example, you can attach a policy-based control to an OU, and all accounts within the OU automatically inherit the policy. You can create multiple OUs within a single organization, and you can create OUs within other OUs. Each OU can contain multiple accounts, and you can move accounts from one OU to another. However, OU names must be unique within a parent OU or root.

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var organizationRootId = config.Require("organizationRootId");
        var testTemplateOU = new AwsNative.Organizations.OrganizationalUnit("testTemplateOU", new()
        {
            Name = "TestTemplateOU",
            ParentId = organizationRootId,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		organizationRootId := cfg.Require("organizationRootId")
    		_, err := organizations.NewOrganizationalUnit(ctx, "testTemplateOU", &organizations.OrganizationalUnitArgs{
    			Name:     pulumi.String("TestTemplateOU"),
    			ParentId: pulumi.String(organizationRootId),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    config = pulumi.Config()
    organization_root_id = config.require("organizationRootId")
    test_template_ou = aws_native.organizations.OrganizationalUnit("testTemplateOU",
        name="TestTemplateOU",
        parent_id=organization_root_id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const config = new pulumi.Config();
    const organizationRootId = config.require("organizationRootId");
    const testTemplateOU = new aws_native.organizations.OrganizationalUnit("testTemplateOU", {
        name: "TestTemplateOU",
        parentId: organizationRootId,
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var organizationRootId = config.Require("organizationRootId");
        var testTemplateOU = new AwsNative.Organizations.OrganizationalUnit("testTemplateOU", new()
        {
            Name = "TestTemplateOU",
            ParentId = organizationRootId,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		organizationRootId := cfg.Require("organizationRootId")
    		_, err := organizations.NewOrganizationalUnit(ctx, "testTemplateOU", &organizations.OrganizationalUnitArgs{
    			Name:     pulumi.String("TestTemplateOU"),
    			ParentId: pulumi.String(organizationRootId),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    config = pulumi.Config()
    organization_root_id = config.require("organizationRootId")
    test_template_ou = aws_native.organizations.OrganizationalUnit("testTemplateOU",
        name="TestTemplateOU",
        parent_id=organization_root_id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const config = new pulumi.Config();
    const organizationRootId = config.require("organizationRootId");
    const testTemplateOU = new aws_native.organizations.OrganizationalUnit("testTemplateOU", {
        name: "TestTemplateOU",
        parentId: organizationRootId,
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var organizationRootId = config.Require("organizationRootId");
        var parentOU = new AwsNative.Organizations.OrganizationalUnit("parentOU", new()
        {
            Name = "ParentOU",
            ParentId = organizationRootId,
        });
    
        var childOU = new AwsNative.Organizations.OrganizationalUnit("childOU", new()
        {
            Name = "ChildOU",
            ParentId = parentOU.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		organizationRootId := cfg.Require("organizationRootId")
    		parentOU, err := organizations.NewOrganizationalUnit(ctx, "parentOU", &organizations.OrganizationalUnitArgs{
    			Name:     pulumi.String("ParentOU"),
    			ParentId: pulumi.String(organizationRootId),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = organizations.NewOrganizationalUnit(ctx, "childOU", &organizations.OrganizationalUnitArgs{
    			Name:     pulumi.String("ChildOU"),
    			ParentId: parentOU.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    config = pulumi.Config()
    organization_root_id = config.require("organizationRootId")
    parent_ou = aws_native.organizations.OrganizationalUnit("parentOU",
        name="ParentOU",
        parent_id=organization_root_id)
    child_ou = aws_native.organizations.OrganizationalUnit("childOU",
        name="ChildOU",
        parent_id=parent_ou.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const config = new pulumi.Config();
    const organizationRootId = config.require("organizationRootId");
    const parentOU = new aws_native.organizations.OrganizationalUnit("parentOU", {
        name: "ParentOU",
        parentId: organizationRootId,
    });
    const childOU = new aws_native.organizations.OrganizationalUnit("childOU", {
        name: "ChildOU",
        parentId: parentOU.id,
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var organizationRootId = config.Require("organizationRootId");
        var parentOU = new AwsNative.Organizations.OrganizationalUnit("parentOU", new()
        {
            Name = "ParentOU",
            ParentId = organizationRootId,
        });
    
        var childOU = new AwsNative.Organizations.OrganizationalUnit("childOU", new()
        {
            Name = "ChildOU",
            ParentId = parentOU.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		organizationRootId := cfg.Require("organizationRootId")
    		parentOU, err := organizations.NewOrganizationalUnit(ctx, "parentOU", &organizations.OrganizationalUnitArgs{
    			Name:     pulumi.String("ParentOU"),
    			ParentId: pulumi.String(organizationRootId),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = organizations.NewOrganizationalUnit(ctx, "childOU", &organizations.OrganizationalUnitArgs{
    			Name:     pulumi.String("ChildOU"),
    			ParentId: parentOU.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    config = pulumi.Config()
    organization_root_id = config.require("organizationRootId")
    parent_ou = aws_native.organizations.OrganizationalUnit("parentOU",
        name="ParentOU",
        parent_id=organization_root_id)
    child_ou = aws_native.organizations.OrganizationalUnit("childOU",
        name="ChildOU",
        parent_id=parent_ou.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const config = new pulumi.Config();
    const organizationRootId = config.require("organizationRootId");
    const parentOU = new aws_native.organizations.OrganizationalUnit("parentOU", {
        name: "ParentOU",
        parentId: organizationRootId,
    });
    const childOU = new aws_native.organizations.OrganizationalUnit("childOU", {
        name: "ChildOU",
        parentId: parentOU.id,
    });
    

    Coming soon!

    Create OrganizationalUnit Resource

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

    Constructor syntax

    new OrganizationalUnit(name: string, args: OrganizationalUnitArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationalUnit(resource_name: str,
                           args: OrganizationalUnitArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationalUnit(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           parent_id: Optional[str] = None,
                           name: Optional[str] = None,
                           tags: Optional[Sequence[_root_inputs.TagArgs]] = None)
    func NewOrganizationalUnit(ctx *Context, name string, args OrganizationalUnitArgs, opts ...ResourceOption) (*OrganizationalUnit, error)
    public OrganizationalUnit(string name, OrganizationalUnitArgs args, CustomResourceOptions? opts = null)
    public OrganizationalUnit(String name, OrganizationalUnitArgs args)
    public OrganizationalUnit(String name, OrganizationalUnitArgs args, CustomResourceOptions options)
    
    type: aws-native:organizations:OrganizationalUnit
    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 OrganizationalUnitArgs
    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 OrganizationalUnitArgs
    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 OrganizationalUnitArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationalUnitArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationalUnitArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    OrganizationalUnit Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The OrganizationalUnit resource accepts the following input properties:

    ParentId string
    The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
    Name string
    The friendly name of this OU.
    Tags List<Pulumi.AwsNative.Inputs.Tag>
    A list of tags that you want to attach to the newly created OU.
    ParentId string
    The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
    Name string
    The friendly name of this OU.
    Tags TagArgs
    A list of tags that you want to attach to the newly created OU.
    parentId String
    The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
    name String
    The friendly name of this OU.
    tags List<Tag>
    A list of tags that you want to attach to the newly created OU.
    parentId string
    The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
    name string
    The friendly name of this OU.
    tags Tag[]
    A list of tags that you want to attach to the newly created OU.
    parent_id str
    The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
    name str
    The friendly name of this OU.
    tags Sequence[TagArgs]
    A list of tags that you want to attach to the newly created OU.
    parentId String
    The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
    name String
    The friendly name of this OU.
    tags List<Property Map>
    A list of tags that you want to attach to the newly created OU.

    Outputs

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

    Arn string
    The Amazon Resource Name (ARN) of this OU.
    AwsId string
    The unique identifier (ID) associated with this OU.
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    The Amazon Resource Name (ARN) of this OU.
    AwsId string
    The unique identifier (ID) associated with this OU.
    Id string
    The provider-assigned unique ID for this managed resource.
    arn String
    The Amazon Resource Name (ARN) of this OU.
    awsId String
    The unique identifier (ID) associated with this OU.
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    The Amazon Resource Name (ARN) of this OU.
    awsId string
    The unique identifier (ID) associated with this OU.
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    The Amazon Resource Name (ARN) of this OU.
    aws_id str
    The unique identifier (ID) associated with this OU.
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    The Amazon Resource Name (ARN) of this OU.
    awsId String
    The unique identifier (ID) associated with this OU.
    id String
    The provider-assigned unique ID for this managed resource.

    Supporting Types

    Tag, TagArgs

    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi