<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi" -->

---
title: Announcing custom execution roles for AWS CloudFormation...
description: AWS CloudFormation StackSets now lets you supply a custom IAM execution role template instead of the default AdministratorAccess role in each member account....
canonical: https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Announcing custom execution roles for AWS CloudFormation StackSets | daily.dev
og:description: AWS CloudFormation StackSets now lets you supply a custom IAM execution role template instead of the default AdministratorAccess role in each member account....
og:url: https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi
og:image: https://api.daily.dev/og/posts/mnTDuiUmI.png
og:image:alt: Announcing custom execution roles for AWS CloudFormation StackSets
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Announcing custom execution roles for AWS CloudFormation StackSets

**[AWS](https://daily.dev/sources/aws)** · 10 min read · 0 upvotes · 0 comments

## Summary

AWS CloudFormation StackSets now lets you supply a custom IAM execution role template instead of the default AdministratorAccess role in each member account. This scopes permissions to least privilege and lets service-managed stack sets deploy templates with nested stacks, macros, and transforms, which was previously unsupported. The role template must contain exactly one AWS::IAM::Role resource, named with the prefix 'stacksets-exec-custom-', include a trust policy for the StackSets service-linked role, and output a 'StackSetExecutionRoleName' key. It must not itself contain nested stacks or transforms, requires CAPABILITY_NAMED_IAM, and only works with the service-managed permissions model. Switching roles does not auto-delete the old AdministratorAccess role.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://aws.amazon.com/blogs/devops/announcing-custom-execution-roles-for-aws-cloudformation-stacksets>

## Questions this post answers

### How do I replace the default AdministratorAccess execution role in AWS CloudFormation StackSets with a least-privilege role?

Supply a custom execution role template via ExecutionRoleTemplateBody or ExecutionRoleTemplateUrl when calling CreateStackSet or UpdateStackSet. The template must contain exactly one AWS::IAM::Role resource named with the prefix 'stacksets-exec-custom-', a trust policy for the StackSets service-linked role, and an output key 'StackSetExecutionRoleName' matching that role name. This only works with the service-managed permissions model and requires CAPABILITY_NAMED_IAM.

_Teams scoping StackSets permissions to least privilege can track CloudFormation changes like this on daily.dev._

### Can a CloudFormation StackSets execution role template include nested stacks or transforms like SAM?

No, the execution role template itself must not include nested stack resources (AWS::CloudFormation::Stack) or transforms such as AWS::Serverless-2016-10-31 or custom macros; violating this causes a validation error. However, once a custom execution role is configured, the workload template deployed by the stack set can use nested stacks, macros, and transforms, a capability previously unavailable to service-managed stack sets.

_Developers deploying SAM-based workloads across accounts can follow StackSets updates like this on daily.dev._

### Why does deleting the old AdministratorAccess execution role not happen automatically when switching to a custom execution role in CloudFormation StackSets?

Switching to a custom execution role or reverting back to the default does not remove the previous role or its bootstrapping stack from member accounts; there is no automated cleanup. To achieve true least-privilege access, you must manually delete the default AdministratorAccess role, or the custom role and its bootstrapping stack, in each member account after confirming the new setup works.

_Engineers cleaning up IAM permissions after a StackSets migration can follow this kind of guidance on daily.dev._

## Similar posts on daily.dev

- [AWS simplifies IAM role creation and setup in service workflows](https://daily.dev/posts/aws-simplifies-iam-role-creation-and-setup-in-service-workflows-j4edti5jy) · AWS · 0 upvotes · 0 comments
- [Where to run AWS workloads and how to limit their access](https://daily.dev/posts/where-to-run-aws-workloads-and-how-to-limit-their-access-whacwrigt) · Datadog · 0 upvotes · 0 comments
- [Take fine-grained control of your AWS CloudFormation StackSets Deployment with StackSet Dependencies](https://daily.dev/posts/take-fine-grained-control-of-your-aws-cloudformation-stacksets-deployment-with-stackset-dependencies-hyg4wrmh1) · AWS · 1 upvotes · 0 comments
- [AWS Introduces CloudFormation Express Mode for Faster Infrastructure Deployments](https://daily.dev/posts/aws-introduces-cloudformation-express-mode-for-faster-infrastructure-deployments-o1q0r1pld) · InfoQ · 0 upvotes · 0 comments
- [Pulumi IAM Expands: Manage Access at Scale with Tags, Roles, and Teams](https://daily.dev/posts/pulumi-iam-expands-manage-access-at-scale-with-tags-roles-and-teams-t4dmxo3pj) · Pulumi · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#aws](https://daily.dev/tags/aws), [#iac](https://daily.dev/tags/iac), [#iam](https://daily.dev/tags/iam), [#aws-cloudformation](https://daily.dev/tags/aws-cloudformation)

[View this post on daily.dev](https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Announcing custom execution roles for AWS CloudFormation StackSets","url":"https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi"},"datePublished":"2026-11-20T00:47:51.965Z","dateModified":"2026-11-20T00:48:17.900Z","description":"AWS CloudFormation StackSets now lets you supply a custom IAM execution role template instead of the default AdministratorAccess role in each member account....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6957d708266fc8e812e9fe9467c005fc?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6957d708266fc8e812e9fe9467c005fc?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"AWS","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"AWS","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/aws","url":"https://daily.dev/sources/aws"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,aws,iac,iam,aws-cloudformation","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AWS","item":"https://daily.dev/sources/aws"},{"@type":"ListItem","position":3,"name":"Announcing custom execution roles for AWS CloudFormation StackSets"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/announcing-custom-execution-roles-for-aws-cloudformation-stacksets-mntduiumi#faq","mainEntity":[{"@type":"Question","name":"How do I replace the default AdministratorAccess execution role in AWS CloudFormation StackSets with a least-privilege role?","acceptedAnswer":{"@type":"Answer","text":"Supply a custom execution role template via ExecutionRoleTemplateBody or ExecutionRoleTemplateUrl when calling CreateStackSet or UpdateStackSet. The template must contain exactly one AWS::IAM::Role resource named with the prefix 'stacksets-exec-custom-', a trust policy for the StackSets service-linked role, and an output key 'StackSetExecutionRoleName' matching that role name. This only works with the service-managed permissions model and requires CAPABILITY_NAMED_IAM. Teams scoping StackSets permissions to least privilege can track CloudFormation changes like this on daily.dev."}},{"@type":"Question","name":"Can a CloudFormation StackSets execution role template include nested stacks or transforms like SAM?","acceptedAnswer":{"@type":"Answer","text":"No, the execution role template itself must not include nested stack resources (AWS::CloudFormation::Stack) or transforms such as AWS::Serverless-2016-10-31 or custom macros; violating this causes a validation error. However, once a custom execution role is configured, the workload template deployed by the stack set can use nested stacks, macros, and transforms, a capability previously unavailable to service-managed stack sets. Developers deploying SAM-based workloads across accounts can follow StackSets updates like this on daily.dev."}},{"@type":"Question","name":"Why does deleting the old AdministratorAccess execution role not happen automatically when switching to a custom execution role in CloudFormation StackSets?","acceptedAnswer":{"@type":"Answer","text":"Switching to a custom execution role or reverting back to the default does not remove the previous role or its bootstrapping stack from member accounts; there is no automated cleanup. To achieve true least-privilege access, you must manually delete the default AdministratorAccess role, or the custom role and its bootstrapping stack, in each member account after confirming the new setup works. Engineers cleaning up IAM permissions after a StackSets migration can follow this kind of guidance on daily.dev."}}]}
```

