Is there a way (data source etc.) to extract Organization Unit (OU) from ID of the account that belongs to that OU?
I can extract various pieces of information from
data "aws_caller_identity" "current" {}
or
data "aws_iam_session_context" "current" {}
But no OU.
Data sources like
data "aws_organizations_organization" {}
or
data "aws_organizations_organizational_units" "ou" {
parent_id = ...
}
don’t provide this particular info either.