Getting started with org-formation by Automating AWS Organizations Deployment.

Introduction

AWS Organizations is a service that helps you centrally manage and govern your environment as you grow and scale your AWS resources. With org-formation, you can create accounts, organize them in hierarchies, apply policies, and automate account creation and management.

Project Overview

Org-Formation-Automation-Architecture

Prerequisites

  1. Clone this repository.
  2. Install aws-cli.
  3. Create an administrator account in the AWS console (don’t use your root account).
    • Grant Policy:
      AdministratorAccess 
      
  4. Setup with the Administrator keys.
    aws configure
    
  5. Install org-formation.
    npm install -g aws-organization-formation
    

Quick Start Guide

To get started with AWS Organizations utilising org-formation, follow these steps:

  1. Create an Organization: Set up your organization in the aws-cli (This can also be performed via the AWS console).

     aws organizations create-organization --feature-set ALL
    
  2. List Accounts: Check the structure of existing accounts.

    aws organizations list-roots
    aws organizations list-accounts
    
  3. Initialise org-formation:

    cd aws-organizations && org-formation init organization.yml
    
  4. Validate Accounts: You may need to check the verification email sent by AWS to the email address indicated as your management account this can be found in the organization.yml file.

  5. Organize and Add Accounts in OU (Organizationl Unit): Add existing accounts or create new ones.

    • In your code editor include additional OU’s and accounts by modifying the structure of the organization.yml.

    • Checkout this sample Cloudformation code for organization.yml

    • Great resource to get the org-formation grips started.

  6. Hide PII (Personal Identifiable Information):

What’s the End Goal?

The end goal is to automate the management and deployment of AWS accounts and keep track of user creation, removal, and privileges. Nevertheless, this can be achieved by version controlling the organization.yml file.

The pipeline will be similar to this.

Org-Formation-Automation-Pipeline

AWS Organizations in birds-eye view.

AWS-Organizations

Testing the Accounts

If you want to test the OrganizationAccountAccessRole after successful deployment.

  1. Login to the Administrator account in the console.
  2. Switch to the newly created account by clicking “Switch Role”.

switch-account01

  1. You can now switch to these accounts from the account menu.

test-account01

Conclusion

©️ rm

© 2025 RM Labs - Welcome! You're visitor number: 

𝕏 GitHub