Skip to main content

Onboarding AWS Accounts Using AWS CLI

In addition to the Console-based onboarding, nOps also supports onboarding AWS Payer (Master) and Child accounts using the AWS CLI. This approach is ideal for users who prefer automation or terminal-based workflows.


Onboarding the AWS Payer (Master) Account

Prerequisites

Before running the CLI command, ensure the following:

  1. You are logged into your AWS Payer (Master) account using the AWS CLI.
  2. Your CLI credentials have Administrator permissions.
  3. AWS CLI is installed and configured via aws configure or using a named profile.

Steps:

After signing up in the nOps platform,

  1. please select Onboard with CLI in the Set Up nOps popup
  2. Click on it and then click Next to continue.

  1. Copy the CLI command and run into your terminal.

aws cloudformation create-stack \
--region us-west-2 \
--stack-name Nops-Integration-1348 \
--template-url https://nops-users.s3.us-west-2.amazonaws.com/uat/v1.2.2/nOpsRole.yaml \
--parameters \
ParameterKey=ApiKey,ParameterValue=<api-key> \
ParameterKey=PayerAccount,ParameterValue=true \
ParameterKey=MinRequiredPermissions,ParameterValue=false \
ParameterKey=OnboardChildAccounts,ParameterValue=true \
--capabilities CAPABILITY_NAMED_IAM
  1. Check the connectivity.

  2. On the success of CloudFormation run in aws console, You should see master payer account and list of linked child accounts.

Minimum Permissions

You can also set MinRequiredPermissions parameter to True while running the CLI command. This option limits the permissions granted to nOps using a least-privilege policy. While this enhances security, note that some nOps features may be unavailable in this mode. Refer to our IAM minimum permission guide for more details.

Onboard Child Accounts

By default, OnboardChildAccounts is set to True in the CLI command. This ensures that all linked child accounts under the master payer account are also onboarded automatically. If you prefer to onboard only the master payer account, you can set this value to False during command run.