I want to convert an AWS CloudFormation self-managed StackSet to a service-managed StackSet.
Resolution
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
Prerequisite: Run the list-stack-instances AWS CLI command to note the stack instance configurations.
To convert the permission model for your StackSet, complete the following steps:
- Open the CloudFormation console.
- In the navigation pane, choose StackSets.
- Select your StackSet.
- Delete the stack instances from StackSets, and then choose Retain stacks.
Note: You can't change the permission model of an existing StackSet that contains stack instances. The StackSet must be empty to convert from self-managed to a service-managed StackSet. To preserve resources, make sure that you retain your stack instances during the deletion process.
- Run the following update-stack-set AWS CLI command to modify the permission model to a service-managed StackSet:
aws cloudformation update-stack-set \
--stack-set-name StackSet_Name \
--use-previous-template \
--permission-model SERVICE_MANAGED \
--auto-deployment Enabled=<boolean>,RetainStacksOnAccountRemoval=<boolean>
Note: Replace StackSet_Name with your stack set name.
- Import the retained stack instances to restore stack instances.