organization_unit#

State module for managing Amazon Organization Units.

async idem_aws.states.aws.organizations.organization_unit.present(hub, ctx, name: str, parent_id: str, tags: List[Dict[str, Any]] = None, resource_id: str = None) Dict[str, Any][source]#

Creates an organizational unit (OU) within a root or parent OU.

An OU is a container for accounts that enables you to organize your accounts to apply policies according to your business requirements. The number of levels deep that you can nest OUs is dependent upon the policy types enabled for that root. For service control policies, the limit is five.

Parameters:
  • name (str) – An Idem name of the resource.

  • parent_id (str) – The unique identifier (ID) of the parent root or OU that you want to create the new OU in.

  • resource_id (str, Optional) – The ID of the organization unit in Amazon Web Services.

  • tags (dict or list, Optional) –

    Dict in the format of {tag-key: tag-value} or List of tags in the format of [{"Key": tag-key, "Value": tag-value}] to associate with the organization unit.

    • Key (str):

      The key identifier, or name, of the tag.

    • Value (str):

      The string value that’s associated with the key of the tag.

Request Syntax:
[idem_test_aws_organizations_organization_unit]:
  aws.organizations.organization_unit.present:
  - name: 'string'
  - resource_id: 'string'
  - parent_id: 'string'
  - tags:
    - Key: 'string'
      Value: 'string'
Returns:

Dict[str, Any]

Examples

idem_test_aws_organizations_organization_unit:
  aws.organizations.organization_unit.present:
    - name: 'idem_test_organization_unit'
    - parent_id: 'o-parent-id'
    - tags:
      - Key: 'provider'
        Value: 'idem'
async idem_aws.states.aws.organizations.organization_unit.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes an organizational unit (OU) from a root or another OU.

You must first remove all accounts and child OUs from the OU that you want to delete. This operation can be called only from the organization’s management account.

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – The ID of the organization unit in Amazon Web Services.

Request syntax:
[idem_test_aws_organizations_organization_unit]:
  aws.organizations.organization_unit.absent:
    - name: 'string'
    - resource_id: 'string'
Returns:

Dict[str, Any]

Examples

idem_test_aws_organizations_organization_unit:
  aws.organizations.organization_unit.absent:
    - name: 'idem_test_organization_unit'
    - resource_id: 'ou-rootid-ouid'
async idem_aws.states.aws.organizations.organization_unit.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describes AWS Organizations Units (OUs) in a way that can be recreated/managed with the corresponding “present” function.

Idem does not support passing arguments to the describe function as of today, hence describe organization_unit will describe all the organizational units one level under the root of the organization. In future if Idem starts supporting input arguments, we can pass any parent_id and this function will list all organizational units one level under the parent.

Returns:

Dict[str, Dict[str, Any]

Examples

$ idem describe aws.organizations.organization_unit