A programmatic way to create an account in AWS Control Tower

July 20, 2022

One of the biggest challenges companies face today is managing multiple teams with different workloads, ensuring they follow the best security practices. 

AWS Control Tower is a multi-account structure that can manage multiple accounts in different organizational units under a single root account, helping organizations meet the unique needs of each application, team, or business group.

Background

The automation cloud is an ideal alternative for companies that need to create accounts for multiple teams with all the security guardrails and configurations. The following AWS tools can help you achieve that objective:

  • AWS CLI
  • AWS API
  • Account Factory for Terraform
  • Account vending through Amazon Lex ChatBot

We will explain how to create an account using AWS CLI and AWS API.

Prerequisites

Before you start, bear in mind the following aspects:

  • The AWS control tower setup should be available.
  • The AWS control tower account factory template should be available with the required CIDR and subnet configuration.
  • The AWS control tower service catalog products should be created and active.
  • You will need an access key and a secret key of an in-place admin user.

Creating an account on AWS CLI

Firstly, you need to install AWS CLI to proceed with the account creation. You can follow these steps if you are using Linux OS:

  • Setup environment variable with the access key and secret key.
  • Retrieve master account value and Define value for admin ARN.
Kceapqyu3zivdqdorsrdr8hpbzf8umbkdovd9q7hauiic hapdkmwmynubtvovrxvliszikuh5t8ugscrv4awqxxo6efvk9fwb

Retrieve the product ID for the account factory product in the region specified earlier.

Nmstl51deino7fonva3ete5uetuebujyurr0s8jxjtboq6besntqk1c6ohuplclovce1nnmfj7xtv0iohyisl2ymomnpgpzhvcayiuj4xje t

Retrieve the provisioning artifact for the account factory.

Bnfrcydsnqw f8delnpbz x36niij2jrnuec15jtgswrxpim8hma9cwwwuwl5uoyf8ljrzdg3yibdgrr9a6vmgr5govkgsh3y73jldc

Create a param.json file with the required parameters, as shown in the following screenshots:

Aquqq2rnxyzx5lypdlokk5zsujxn5zatq ax8kqgdegg2yh 6xbjicggeut7s7jwk0hij goqkovtapn qyqhvtez9emnf82yvxk4l8frbpitffcolo9cvmbm icz6fqovtdi joi 9f1p73ow

Derive the catalog name and email id from params.json. Catalog names can be anything unique. It can be the same as an account name. Here we are adding the prefix “CatalogFor” to the account name.

Sb0j8bk1qgys6op icta64t6bbapnw8g0fbip9vrd4nsza08ddhvh9pmzm eis515mbeodsdlrre68e83edbapsd5rwrwdtgcz bfxmkgprknkssrr4m ivbimohgnvfhry22avy5mm4sktpdw

To create a new account programmatically, you need to write this command:

Fu2gezk2u6c9j6nl mxc0wdik51ix4poabc oe1dsvmcwgwkxesdrgbjf5fwo0mcmk4on6sb3sfed2eqm77p1vmbmfuktckxm08gcohlvep 1u79poqawvkbbbvvhre062yl7mnkiam2vcjg

AWS SDK API

Another way to create AWS Control Tower account is through AWS SDK.

For more details, refer to the AWS document.

 

Onqokgu5ujcedhkbuvhczdd953yd0emnr8lfpggows3azbm1 3gbx lfehsvki 5ujktcluatvldyp9zjt xhalpt rcoo qbg1nfgap f8pcufxiq6oyrm3sknmdvkdkbwfduu

 

Account Status

Now you can view the status of the account created in the AWS Control Tower console. 

Ixxa9w7bclvph0 9jsycydawousl7gcer5takeffamkdn180laryeg9nuc64zurj8nratbm7oluitfzrwkmfco1egu6t5wxz 38jwje7 cp8bigb 4i ny6q2b0neflbmukli

Then you will receive an email to create the account.

Okcnrwxm jmk484xjzmeu6ljitd9zphvkh4ri9aetp ehwqgoh07w00auqmouuiiposavqp683llagaw2sqontaucltrjw32fdnn0qjuhudsjjhsfj0zgaqg4lr3qd6qwo 5lezerbvlfvb8va

Steps to access AWS Control Tower Account

Go to the AWS Management Console and sign in.

Gt7bplfjjsc6vlledyibtypnmu1jloqopbsj6ahugq10z4zitrfgceofnugnqgrgmbqkc5humfhbutyukjtjuaz3o1zxncvlh1jtpuytxg1ifh59qxcjlaczzghj slsboqn1gmcbzfj6rrmog

Select root user and then enter the root user email address. Then complete the security check.

3tgbdfg4urt9 7hwqlrasmrjg5sycx

Now click forgot password on the emerging window, enter the captcha and email. You will get the link on the root email to reset the password.

Ufaygps2bl1jtfmk2ohg gsz io9krrezfhbleygil8h6890

Change the password and log in.

Bsabxm qudpeffwgiaa84xg8h24bbgpaeook6ne58zi91oc5hhb2kcrfmfdvivzkq8zz pi 4g8m3gwumjp7iu6aezzr2fimypp7xcs5bp

By following the steps, you will create an account with all the mandatory guardrails and SCPs (Service Control Policies). There is no additional charge to use AWS Control Tower. However, when you set up AWS Control Tower, you will incur costs for AWS services configured to set up your landing zone and mandatory guardrails. While some AWS services like AWS Organizations and AWS Single Sign-On (SSO) come at no additional charge, you will pay for services such as AWS Service Catalog, AWS CloudTrail, AWS Config, Amazon CloudWatch, Amazon Simple Notification Service (SNS), Amazon Simple Storage Service (S3), and Amazon Virtual Private Cloud (VPC), based on your usage of these services. You only have to pay for what you use.

Using an AWS Control Tower provides organizations with the flexibility and speed required to manage multiple accounts on a single dashboard. As a result, companies have more control and visibility on their digital environment. Get to know more about our cybersecurity practices here.

Related Articles

Trending Topics

Blockchain
Globant Experience
Life Sciences
Metaverse
Sustainable Business
Technology

Subscribe to our newsletter

Receive the latests news, curated posts and highlights from us. We’ll never spam, we promise.

More From

The Cybersecurity Studio focuses on reducing our clients’ cybersecurity risks. To help businesses adapt, we established a Digital Cybersecurity Framework founded by our key practices. Our value proposition considers an active participation in the software development process and a proactive view on cybersecurity solutions that include regular vulnerability tests and threat intelligence.