Skip to content

Organizations: add ListParents (OU/account parent read-back for Terraform) #990

Description

@b-rajesh

AWS Service name

Organizations

Operations needed

  • ListParents(ChildId)ChildId is an ou-* id or an account id. Read the stored parent and return the single parent AWS returns:
    { "Parents": [ { "Id": "<parent_id>", "Type": "ROOT" | "ORGANIZATIONAL_UNIT" } ] }
    (Type = ROOT when the parent id starts with r-, else ORGANIZATIONAL_UNIT). Return ChildNotFoundException for an unknown ChildId.

Use case

A multi-OU Terraform/OpenTofu build (aws_organizations_organizational_unit) creates OUs via CreateOrganizationalUnit (already supported), but the provider's Read then calls ListParents to populate parent_id — real-AWS DescribeOrganizationalUnit doesn't return the parent, so the provider must ListParents the child, and in SDKv2 this fires on every create and refresh. ListParents isn't implemented, so apply errors on the read-back (InvalidAction: Operation 'ListParents' not implemented): nested OUs never get created, outputs are empty, idempotency is unreachable. This single read op unblocks the whole OU-hierarchy flow locally. (It also covers the account read-back needed if CreateAccount/MoveAccount are added later.)

Would you like to contribute this?

  • Yes, I'd like to implement this service and open a PR
  • I can help review/test an implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions