AWS Cost Categories allow organizing spending based on rules mapping costs to the business structure.The approach described in the article automates the alignment of AWS Cost Categories with the AWS Organizations Organizational Unit (OU) structure.The script assigns accounts to category names derived from the OU path and generates Cost Category rules accordingly.The script enables cost analysis based on OU level categorization of accounts, providing a useful perspective for understanding costs.