We recommend new projects start with resources from the AWS provider.
aws-native.organizations.OrganizationalUnit
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
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:
- Parent
Id 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.
- List<Pulumi.
Aws Native. Inputs. 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.
- Sequence[Tag
Args] - A list of tags that you want to attach to the newly created OU.
- parent
Id 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.
- 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:
Supporting Types
Tag, TagArgs
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.