How to Update N2W IAM Permissions with CloudFormation Templates

N2W now turns IAM permission updates into a CloudFormation stack you deploy once per AWS account. After each upgrade, you update that stack instead of editing policies by hand.
Share post:

N2W upgrades just got a lot simpler. You no longer have to edit each IAM policy after an upgrade. N2W now generates a ready-to-deploy AWS CloudFormation template that holds every permission the new version needs. You deploy it once per AWS account, and on every later release you simply update the same stack.

Why this matters

Each N2W release can add features that need new AWS permissions. Until now, keeping up meant downloading three JSON policy files, opening each N2W IAM role or user in the AWS console, and pasting the new policy text in by hand. Across 20, 30 or 100+ AWS accounts, that is slow, repetitive and easy to get wrong.

The new Generate Permissions Template action replaces that routine:

  • All three N2W policies in one file per AWS account, instead of three separate edits.
  • Many accounts in one click. Select several N2W accounts and download a ZIP with one template per AWS account.
  • Repeatable upgrades. The same CloudFormation stack is updated release after release, so you always know where N2W’s permissions live.
  • You stay in control. N2W never touches IAM itself. It only builds the file; your IAM admin deploys it.

Before you start

You need N2W 5.0 or later and someone with IAM and CloudFormation rights in each target AWS account. Upgrade N2W first: the template always reflects the permissions of the version you are running.

ItemWhat’s supported
CloudAWS only. Selecting any Azure, GCP or Wasabi account greys out the action.
AuthenticationAssume Role, N2W (CPM) Instance Role, and IAM User
Account typesBackup and DR, including Secured DR accounts
SelectionOne N2W account, or many at once
OutputOne JSON template, or a ZIP with one template per AWS account

The key idea: one template and one stack per AWS account. N2W groups your selected N2W accounts by the AWS account they live in (the “home account”). If the same AWS account was onboarded to N2W several times, say once with an IAM user and once with a role, a single template covers all of them. Three AWS accounts means three templates.

Step 1: Generate the permissions template in N2W

  1. In N2W, go to Accounts.
  2. Tick one or more AWS accounts. Generate Permissions Template in the toolbar turns active once your selection is valid.
  1. Click Generate Permissions Template. The dialog lists the CloudFormation stack name for each AWS account and the N2W roles or users it will update.

Generate Permissions Template dialog for a single account

With several accounts selected, you’ll see one stack per AWS account. In the example above, five N2W accounts map to three AWS accounts, so three stacks. The account using the N2W instance role is listed in its own group.

Dialog grouping several N2W accounts into one stack per AWS account

  1. Note the two messages in the dialog. The blue one reminds you to update this same stack on future releases. The yellow one warns that redeploying overwrites any hand edits to N2W’s own policies.
  2. Click Download. A single account gives you one .json file. Multiple AWS accounts give you a ZIP with one file each, named N2W-CPM-Permissions-<AWS account ID>.json.

The downloaded ZIP holds one template per AWS account

Each file is a standard CloudFormation template. It defines N2W’s managed IAM policies and attaches them to the right roles or users. Its description repeats the stack name and AWS account it belongs to, so you can’t mix them up.

Inside a template: the description names the stack and the AWS account

💡Tip: Generate Backup and DR accounts separately. If your selection mixes the two, N2W shows “Selection mixes Backup and DR accounts. Generate one type at a time. Note that there will be an error shown when Backup and DR accounts are selected together.

Step 2: First time only: create the stack in CloudFormation

Do this once in each AWS account, using the template whose file name matches that account’s ID.

  1. Sign in to the AWS account named in the template and open CloudFormation.

Opening CloudFormation from the AWS console

  1. Choose Create stack → With new resources (standard). Don’t choose “with existing resources”.
  2. Under Prepare template, select Choose an existing template. For Template source, select Upload a template file, click Choose file and pick the downloaded .json. Click Next.
  3. For Stack name, enter the suggested name exactly: N2W-CPM-Permissions-<AWS account ID>. There are no parameters to fill in. Click Next.
  4. On Configure stack options, leave the settings at their defaults, but scroll to Capabilities at the bottom and tick ‘I acknowledge that AWS CloudFormation might create IAM resources with custom names.’ Click Next.
  5. On Review and create, click Submit.
  6. Wait for the stack status to show CREATE_COMPLETE.

Repeat for each template in the ZIP, signing in to the matching AWS account each time.

Step 3: Every later release: update the same stack

After each N2W upgrade, generate a fresh template (Step 1) and apply it to the stack you already have. Don’t create a new one.

  1. In CloudFormation, open your existing N2W-CPM-Permissions-<AWS account ID> stack and click Update stack.

The existing N2W permissions stack in the CloudFormation stack list

  1. If prompted how to apply it, choose Make a direct update. A change set only previews the changes and is optional here.
  2. Under Prepare template, select Replace existing template, then Upload a template file. Choose the newly downloaded .json for this account. Click Next.

Replace existing template and upload the new file

  1. Click Next through the remaining pages. There are no parameters to change.
  2. On Configure stack options, leave the settings at their defaults, but scroll to Capabilities at the bottom and tick ‘I acknowledge that AWS CloudFormation might create IAM resources with custom names.’ Click Next.
  3. On Review, click Submit.
  4. Wait for UPDATE_COMPLETE. The stack replaces N2W’s managed policies in place with the new version’s permissions.

If nothing changed between releases, CloudFormation reports “No updates are to be performed.” That’s expected and safe.

Best practices

Do

  • Deploy each template in its own AWS account. The dialog and the file name tell you which account each one belongs to.
  • Keep one stack per AWS account, with the suggested name. Every future upgrade reuses it.
  • Redeploy freely. The template always holds the full permission set, so running it again is harmless.
  • Keep your own extra permissions in a separate IAM policy. The stack only manages N2W’s policies and never touches yours.

Don’t

  • Don’t create a new stack each release. A new stack tries to recreate the same fixed-name policies, and CloudFormation fails with AlreadyExists. Always update.
  • Don’t rename anything: not the stack, the IAM role, the IAM user, or the N2W-managed policies. The template attaches policies by name, so a rename breaks the update and can break N2W’s access.
  • Don’t hand-edit N2W’s managed policies. The next redeploy overwrites your edits. If you trim permissions you don’t use, such as EFS or FSx, you’ll need to remove them again after each update.
  • Don’t expect N2W to deploy for you. N2W only creates the file. Your IAM admin deploys it.

Troubleshooting

SymptomLikely cause and fix
Generate Permissions Template is greyed outYour selection includes a non-AWS account (Azure, GCP, Wasabi) or nothing is selected. Select AWS accounts only.
“Selection mixes Backup and DR accounts”Generate Backup accounts and DR accounts in separate runs.
An account is skipped or can’t be resolvedFor IAM User accounts, the access key may have expired. Update the credentials on the account in N2W and generate again.
You can’t find your existing stackCheck that you’re in the same AWS Region where you created it.
AlreadyExists errorYou created a new stack instead of updating the existing one. Update the original stack.
Cannot exceed quota for PoliciesPerUserThe IAM user already has the AWS maximum of managed policies attached. Detach unused policies, or request a quota increase, then update the stack again.

💡Note that creating the stack in a different Region by mistake will also hit AlreadyExists, because IAM is global even though stacks are regional.

FAQ

Does N2W change IAM in my account? No. N2W only generates the template. Nothing changes until your admin deploys it.

Do I need extra permissions to use this feature? No. Generating the template needs no additional AWS permissions.

Do I need to do this every release? Yes, whenever you upgrade. Generate a fresh template and update the same stack. If nothing changed, CloudFormation says so.

Can I prepare permissions before I upgrade? No. The template reflects the version you’re running, so upgrade N2W first, then update the stack.

Why one file per AWS account? A CloudFormation stack runs inside one AWS account. Every N2W account onboarded from the same AWS account shares one template.

I manage 100+ AWS accounts. Is there a faster way? Each AWS account still needs its own deployment. Teams at that scale usually run the templates from their existing automation pipeline, looping through accounts.

Can I still update permissions the old way? Yes. The JSON policy files still work. The template is simply faster.

What about Azure and GCP? The feature is AWS-only for now.

Wrapping up

Updating N2W permissions now comes down to three moves: upgrade N2W, generate the template, and update one stack per AWS account. You’ll do the setup once, and every upgrade after that takes a few clicks per account instead of three hand-edited policies.

Ready to try it? Need an upgrade to the latest N2W?

Open Accounts, and click Generate Permissions Template. For the full reference, see section 2.2.1.1 of the N2W User Guide. Book a call and we’ll walk you through the entire process.

You might also like