OrganizationalUnit
Provides a resource to create an organizational unit.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Organizations.OrganizationalUnit("example", new Aws.Organizations.OrganizationalUnitArgs
{
ParentId = aws_organizations_organization.Example.Roots[0].Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/organizations"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.NewOrganizationalUnit(ctx, "example", &organizations.OrganizationalUnitArgs{
ParentId: pulumi.String(aws_organizations_organization.Example.Roots[0].Id),
})
if err != nil {
return err
}
return nil
})
}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,
});Create a OrganizationalUnit Resource
new OrganizationalUnit(name: string, args: OrganizationalUnitArgs, opts?: CustomResourceOptions);def OrganizationalUnit(resource_name, opts=None, name=None, parent_id=None, __props__=None);func NewOrganizationalUnit(ctx *Context, name string, args OrganizationalUnitArgs, opts ...ResourceOption) (*OrganizationalUnit, error)public OrganizationalUnit(string name, OrganizationalUnitArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
OrganizationalUnit Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The OrganizationalUnit resource accepts the following input properties:
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.
Look up an 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): OrganizationalUnitstatic get(resource_name, id, opts=None, accounts=None, arn=None, name=None, parent_id=None, __props__=None);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)- 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.
The following state arguments are supported:
- 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
- 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
- Name string
The name for the organizational unit
- Parent
Id string ID of the parent organizational unit, which may be the root
- 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
- name string
The name for the organizational unit
- parent
Id string ID of the parent organizational unit, which may be the root
- 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 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
Supporting Types
OrganizationalUnitAccount
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.