1. Packages
  2. AWS
  3. API Docs
  4. organizations
  5. OrganizationalUnit
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.organizations.OrganizationalUnit

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a resource to create an organizational unit.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.organizations.OrganizationalUnit("example", {
        name: "example",
        parentId: exampleAwsOrganizationsOrganization.roots[0].id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.organizations.OrganizationalUnit("example",
        name="example",
        parent_id=example_aws_organizations_organization["roots"][0]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organizations.NewOrganizationalUnit(ctx, "example", &organizations.OrganizationalUnitArgs{
    			Name:     pulumi.String("example"),
    			ParentId: pulumi.Any(exampleAwsOrganizationsOrganization.Roots[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Organizations.OrganizationalUnit("example", new()
        {
            Name = "example",
            ParentId = exampleAwsOrganizationsOrganization.Roots[0].Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.organizations.OrganizationalUnit;
    import com.pulumi.aws.organizations.OrganizationalUnitArgs;
    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 example = new OrganizationalUnit("example", OrganizationalUnitArgs.builder()
                .name("example")
                .parentId(exampleAwsOrganizationsOrganization.roots()[0].id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:organizations:OrganizationalUnit
        properties:
          name: example
          parentId: ${exampleAwsOrganizationsOrganization.roots[0].id}
    

    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[Mapping[str, str]] = 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: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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var organizationalUnitResource = new Aws.Organizations.OrganizationalUnit("organizationalUnitResource", new()
    {
        ParentId = "string",
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := organizations.NewOrganizationalUnit(ctx, "organizationalUnitResource", &organizations.OrganizationalUnitArgs{
    	ParentId: pulumi.String("string"),
    	Name:     pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var organizationalUnitResource = new OrganizationalUnit("organizationalUnitResource", OrganizationalUnitArgs.builder()
        .parentId("string")
        .name("string")
        .tags(Map.of("string", "string"))
        .build());
    
    organizational_unit_resource = aws.organizations.OrganizationalUnit("organizationalUnitResource",
        parent_id="string",
        name="string",
        tags={
            "string": "string",
        })
    
    const organizationalUnitResource = new aws.organizations.OrganizationalUnit("organizationalUnitResource", {
        parentId: "string",
        name: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:organizations:OrganizationalUnit
    properties:
        name: string
        parentId: string
        tags:
            string: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The OrganizationalUnit resource accepts the following input properties:

    ParentId string
    ID of the parent organizational unit, which may be the root
    Name string
    The name for the organizational unit
    Tags Dictionary<string, string>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    ParentId string
    ID of the parent organizational unit, which may be the root
    Name string
    The name for the organizational unit
    Tags map[string]string
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    parentId String
    ID of the parent organizational unit, which may be the root
    name String
    The name for the organizational unit
    tags Map<String,String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    parentId string
    ID of the parent organizational unit, which may be the root
    name string
    The name for the organizational unit
    tags {[key: string]: string}
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    parent_id str
    ID of the parent organizational unit, which may be the root
    name str
    The name for the organizational unit
    tags Mapping[str, str]
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    parentId String
    ID of the parent organizational unit, which may be the root
    name String
    The name for the organizational unit
    tags Map<String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

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

    Accounts List<OrganizationalUnitAccount>
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    Arn string
    ARN of the organizational unit
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Accounts []OrganizationalUnitAccount
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    Arn string
    ARN of the organizational unit
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts List<OrganizationalUnitAccount>
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn String
    ARN of the organizational unit
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts OrganizationalUnitAccount[]
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn string
    ARN of the organizational unit
    id string
    The provider-assigned unique ID for this managed resource.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts Sequence[OrganizationalUnitAccount]
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn str
    ARN of the organizational unit
    id str
    The provider-assigned unique ID for this managed resource.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts List<Property Map>
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn String
    ARN of the organizational unit
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Look up Existing OrganizationalUnit Resource

    Get an existing OrganizationalUnit 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?: OrganizationalUnitState, opts?: CustomResourceOptions): OrganizationalUnit
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accounts: Optional[Sequence[OrganizationalUnitAccountArgs]] = None,
            arn: Optional[str] = None,
            name: Optional[str] = None,
            parent_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> OrganizationalUnit
    func GetOrganizationalUnit(ctx *Context, name string, id IDInput, state *OrganizationalUnitState, opts ...ResourceOption) (*OrganizationalUnit, error)
    public static OrganizationalUnit Get(string name, Input<string> id, OrganizationalUnitState? state, CustomResourceOptions? opts = null)
    public static OrganizationalUnit get(String name, Output<String> id, OrganizationalUnitState 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:
    Accounts List<OrganizationalUnitAccount>
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    Arn string
    ARN of the organizational unit
    Name string
    The name for the organizational unit
    ParentId string
    ID of the parent organizational unit, which may be the root
    Tags Dictionary<string, string>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Accounts []OrganizationalUnitAccountArgs
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    Arn string
    ARN of the organizational unit
    Name string
    The name for the organizational unit
    ParentId string
    ID of the parent organizational unit, which may be the root
    Tags map[string]string
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts List<OrganizationalUnitAccount>
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn String
    ARN of the organizational unit
    name String
    The name for the organizational unit
    parentId String
    ID of the parent organizational unit, which may be the root
    tags Map<String,String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts OrganizationalUnitAccount[]
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn string
    ARN of the organizational unit
    name string
    The name for the organizational unit
    parentId string
    ID of the parent organizational unit, which may be the root
    tags {[key: string]: string}
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts Sequence[OrganizationalUnitAccountArgs]
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn str
    ARN of the organizational unit
    name str
    The name for the organizational unit
    parent_id str
    ID of the parent organizational unit, which may be the root
    tags Mapping[str, str]
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    accounts List<Property Map>
    List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
    arn String
    ARN of the organizational unit
    name String
    The name for the organizational unit
    parentId String
    ID of the parent organizational unit, which may be the root
    tags Map<String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Supporting Types

    OrganizationalUnitAccount, OrganizationalUnitAccountArgs

    Arn string
    ARN of the organizational unit
    Email string
    Email of the account
    Id string
    Identifier of the organization unit
    Name string
    The name for the organizational unit
    Arn string
    ARN of the organizational unit
    Email string
    Email of the account
    Id string
    Identifier of the organization unit
    Name string
    The name for the organizational unit
    arn String
    ARN of the organizational unit
    email String
    Email of the account
    id String
    Identifier of the organization unit
    name String
    The name for the organizational unit
    arn string
    ARN of the organizational unit
    email string
    Email of the account
    id string
    Identifier of the organization unit
    name string
    The name for the organizational unit
    arn str
    ARN of the organizational unit
    email str
    Email of the account
    id str
    Identifier of the organization unit
    name str
    The name for the organizational unit
    arn String
    ARN of the organizational unit
    email String
    Email of the account
    id String
    Identifier of the organization unit
    name String
    The name for the organizational unit

    Import

    Using pulumi import, import AWS Organizations Organizational Units using the id. For example:

    $ pulumi import aws:organizations/organizationalUnit:OrganizationalUnit example ou-1234567
    

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

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi