AWS Classic v5.41.0, May 15 23
AWS Classic v5.41.0, May 15 23
aws.organizations.OrganizationalUnit
Explore with Pulumi AI
Provides a resource to create an organizational unit.
Example Usage
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()
{
ParentId = aws_organizations_organization.Example.Roots[0].Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/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{
ParentId: pulumi.Any(aws_organizations_organization.Example.Roots[0].Id),
})
if err != nil {
return err
}
return nil
})
}
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()
.parentId(aws_organizations_organization.example().roots()[0].id())
.build());
}
}
import pulumi
import pulumi_aws as aws
example = aws.organizations.OrganizationalUnit("example", parent_id=aws_organizations_organization["example"]["roots"][0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.organizations.OrganizationalUnit("example", {parentId: aws_organizations_organization.example.roots[0].id});
resources:
example:
type: aws:organizations:OrganizationalUnit
properties:
parentId: ${aws_organizations_organization.example.roots[0].id}
Create OrganizationalUnit Resource
new OrganizationalUnit(name: string, args: OrganizationalUnitArgs, opts?: CustomResourceOptions);
@overload
def OrganizationalUnit(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
parent_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
@overload
def OrganizationalUnit(resource_name: str,
args: OrganizationalUnitArgs,
opts: Optional[ResourceOptions] = 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.
- 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 ID of the parent organizational unit, which may be the root
- Name string
The name for the organizational unit
- 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.
- Parent
Id string ID of the parent organizational unit, which may be the root
- Name string
The name for the organizational unit
- 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.
- parent
Id String ID of the parent organizational unit, which may be the root
- name String
The name for the organizational unit
- 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.
- parent
Id string ID of the parent organizational unit, which may be the root
- name string
The name for the organizational unit
- {[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
- 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.
- parent
Id String ID of the parent organizational unit, which may be the root
- name String
The name for the organizational unit
- 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<Organizational
Unit Account> 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.
- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Accounts
[]Organizational
Unit Account 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.
- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- accounts
List<Organizational
Unit Account> 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.
- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- accounts
Organizational
Unit Account[] 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.
- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- accounts
Sequence[Organizational
Unit Account] 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.
- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
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.
- Accounts
List<Organizational
Unit Account Args> 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
- Parent
Id string ID of the parent organizational unit, which may be the root
- 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.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Accounts
[]Organizational
Unit Account Args 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
- Parent
Id string ID of the parent organizational unit, which may be the root
- 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.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- accounts
List<Organizational
Unit Account Args> 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
- parent
Id String ID of the parent organizational unit, which may be the root
- 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.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- accounts
Organizational
Unit Account Args[] 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
- parent
Id string ID of the parent organizational unit, which may be the root
- {[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.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- accounts
Sequence[Organizational
Unit Account Args] 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
- 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.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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
- parent
Id String ID of the parent organizational unit, which may be the root
- 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.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
OrganizationalUnitAccount
Import
AWS Organizations Organizational Units can be imported by using the id
, e.g.,
$ pulumi import aws:organizations/organizationalUnit:OrganizationalUnit example ou-1234567
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.