US-12625739-B2 - Automated nesting of existing stacks in a root stack within an AWS environment
Abstract
System, method, and software of moving existing stacks in an AWS environment into a root stack. In one embodiment, a stack nesting system obtains a root template that describes a root stack in the AWS environment, identifies a nested stack existing in the AWS environment that is referenced in the root template, interacts with an AWS provisioning service (e.g., AWS CloudFormation) to update the nested stack to preclude default values assigned to parameters of the nested stack, and interacts with the AWS provisioning service to import the nested stack within the root stack in the AWS environment.
Inventors
- Michael Glen Lotz
- Benjamin Beatty
- Marquis G. Waller
Assignees
- Michael Glen Lotz
- Benjamin Beatty
- Marquis G. Waller
Dates
- Publication Date
- 20260512
- Application Date
- 20220308
Claims (20)
- 1 . A stack nesting system comprising: a nesting controller comprising at least one processor and memory; and an interface component configured to communicate with an Amazon Web Services (AWS) provisioning service in an AWS environment over a network connection, the AWS environment comprising a pool of AWS resources; wherein the AWS provisioning service comprises an infrastructure automation service that automates deployment of the AWS resources by building AWS stacks described in AWS templates; wherein an AWS template describes the AWS resources of the pool that a user wants to provision in the AWS environment; wherein an AWS stack comprises a collection of the AWS resources described in an associated AWS template and provisioned in the AWS environment, which is managed as a single unit; wherein the nesting controller is configured to perform an automated process of importing an existing AWS stack existing in the AWS environment as a nested AWS stack into a root AWS stack by: obtaining a root AWS template that describes the AWS resources to automatically provision for the root AWS stack in the AWS environment via the AWS provisioning service; identifying the nested AWS stack referenced by a nested stack resource in a resources section of the root AWS template, wherein the nested stack resource is a type of resource that creates the nested AWS stack within another AWS stack; interacting with the AWS provisioning service to update the nested AWS stack to preclude default values assigned to parameters of the nested AWS stack; and interacting with the AWS provisioning service to import the nested AWS stack within the root AWS stack in the AWS environment.
- 2 . The stack nesting system of claim 1 wherein the nesting controller is further configured to: retrieve a nested stack AWS template for the nested AWS stack referenced in the root AWS template; modify the nested stack AWS template to remove a default property from each of one or more parameters that declare the default property; modify the nested stack AWS template to include a benign change that induces the AWS provisioning service to create a change set for the nested AWS stack; and interact with the AWS provisioning service to update the nested AWS stack in the AWS environment based on a modified nested stack AWS template.
- 3 . The stack nesting system of claim 2 wherein the nesting controller is further configured to: specify a dummy output in the modified nested stack AWS template as the benign change.
- 4 . The stack nesting system of claim 2 wherein the nesting controller is further configured to: specify a dummy resource in the modified nested stack AWS template as the benign change; and specify a failure condition in the modified nested stack AWS template to create the dummy resource dependent on a decision that will be false.
- 5 . The stack nesting system of claim 1 wherein the nesting controller is further configured to: generate a temporary root AWS template for the root AWS stack, wherein the temporary root AWS template specifies the nested stack resource that references the nested AWS stack, a list of parameters associated with the nested stack resource, and a list of tags associated with the nested stack resource; and interact with the AWS provisioning service to update the root AWS stack in the AWS environment based on the temporary root AWS template.
- 6 . The stack nesting system of claim 5 wherein the nesting controller is further configured to: run a change set command of type import specifying the temporary root AWS template; and specify a mapping of a logical resource identifier for the nested stack resource to a stack identifier for the nested AWS stack referenced in the nested stack resource.
- 7 . The stack nesting system of claim 1 wherein the nesting controller is further configured to: interact with the AWS provisioning service to create the root AWS stack in the AWS environment as an empty stack when the root AWS stack does not exist in the AWS environment upon obtaining the root AWS template.
- 8 . The stack nesting system of claim 1 wherein: the nested stack resource specifies a stack name property that indicates a stack name that is mapped to a stack identifier specified by the AWS provisioning service when the nested AWS stack was created in the AWS environment; and the nesting controller is further configured to: remove the stack name property from the root AWS template; and interact with the AWS provisioning service to update the root AWS stack in the AWS environment based on the root AWS template.
- 9 . The stack nesting system of claim 1 wherein: the AWS provisioning service comprises an AWS CloudFormation service.
- 10 . A method comprising: communicating with an Amazon Web Services (AWS) provisioning service in an AWS environment over a network connection, the AWS environment comprising a pool of AWS resources; wherein the AWS provisioning service comprises an infrastructure automation service that automates deployment of the AWS resources by building AWS stacks described in AWS templates; wherein an AWS template describes the AWS resources of the pool that a user wants to provision in the AWS environment; wherein an AWS stack comprises a collection of the AWS resources described in an associated AWS template and provisioned in the AWS environment, which is managed as a single unit; wherein the method further comprises performing an automated process of importing an existing AWS stack existing in the AWS environment as a nested AWS stack into a root AWS stack by: obtaining a root AWS template that describes the AWS resources to automatically provision for the root AWS stack in the AWS environment via the AWS provisioning service; identifying the nested AWS stack referenced by a nested stack resource in a resources section of the root AWS template, wherein the nested stack resource is a type of resource that creates the nested AWS stack within another AWS stack; interacting with the AWS provisioning service to update the nested AWS stack to preclude default values assigned to parameters of the nested AWS stack; and interacting with the AWS provisioning service to import the nested AWS stack within the root AWS stack in the AWS environment.
- 11 . The method of claim 10 wherein interacting with the AWS provisioning service to update the nested AWS stack comprises: retrieving a nested stack AWS template for the nested AWS stack referenced in the root AWS template; modifying the nested stack AWS template to remove a default property from each of one or more parameters that declare the default property; modifying the nested stack AWS template to include a benign change that induces the AWS provisioning service to create a change set for the nested AWS stack; and interacting with the AWS provisioning service to update the nested AWS stack in the AWS environment based on a modified nested stack AWS template.
- 12 . The method of claim 11 wherein modifying the nested stack AWS template to include the benign change comprises: specifying a dummy output in the modified nested stack AWS template.
- 13 . The method of claim 11 wherein modifying the nested stack AWS template to include the benign change comprises: specifying a dummy resource in the modified nested stack AWS template; and specifying a failure condition in the modified nested stack AWS template to create the dummy resource dependent on a decision that will be false.
- 14 . The method of claim 10 wherein interacting with the AWS provisioning service to import the nested AWS stack within the root AWS stack comprises: generating a temporary root AWS template for the root AWS stack, wherein the temporary root AWS template specifies the nested stack resource that references the nested AWS stack, a list of parameters associated with the nested stack resource, and a list of tags associated with the nested stack resource; and interacting with the AWS provisioning service to update the root AWS stack in the AWS environment based on the temporary root AWS template.
- 15 . The method of claim 14 wherein interacting with the AWS provisioning service to update the root AWS stack comprises: running a change set command of type import specifying the temporary root AWS template; and specifying a mapping of a logical resource identifier for the nested stack resource to a stack identifier for the nested AWS stack referenced in the nested stack resource.
- 16 . The method of claim 10 further comprising: interacting with the AWS provisioning service to create the root AWS stack in the AWS environment as an empty stack when the root AWS stack does not exist in the AWS environment upon obtaining the root AWS template.
- 17 . The method of claim 10 wherein: the nested stack resource specifies a stack name property that indicates a stack name that is mapped to a stack identifier specified by the AWS provisioning service when the nested AWS stack was created in the AWS environment; and the method further comprises: removing the stack name property from the root AWS template; and interacting with the AWS provisioning service to update the root AWS stack in the AWS environment based on the root AWS template.
- 18 . A non-transitory computer readable medium embodying programmed instructions executed by a processor, wherein the instructions direct the processor to implement a method comprising: communicating with an Amazon Web Services (AWS) provisioning service in an AWS environment over a network connection, the AWS environment comprising a pool of AWS resources; wherein the AWS provisioning service comprises an infrastructure automation service that automates deployment of the AWS resources by building AWS stacks described in AWS templates; wherein an AWS template describes the AWS resources of the pool that a user wants to provision in the AWS environment; wherein an AWS stack comprises a collection of the AWS resources described in an associated AWS template and provisioned in the AWS environment, which is managed as a single unit; wherein the method further comprises performing an automated process of importing an existing AWS stack existing in the AWS environment as a nested AWS stack into a root AWS stack by: obtaining a root AWS template that describes the AWS resources to automatically provision for the root AWS stack in the AWS environment via the AWS provisioning service; identifying the nested AWS stack referenced by a nested stack resource in a resources section of the root AWS template, wherein the nested stack resource is a type of resource that creates the nested AWS stack within another AWS stack; interacting with the AWS provisioning service to update the nested AWS stack to preclude default values assigned to parameters of the nested AWS stack; and interacting with the AWS provisioning service to import the nested AWS stack within the root AWS stack in the AWS environment.
- 19 . The computer readable medium of claim 18 wherein interacting with the AWS provisioning service to update the nested AWS stack comprises: retrieving a nested stack AWS template for the nested AWS stack referenced in the root AWS template; modifying the nested stack AWS template to remove a default property from each of one or more parameters that declare the default property; modifying the nested stack AWS template to include a benign change that induces the AWS provisioning service to create a change set for the nested AWS stack; and interacting with the AWS provisioning service to update the nested AWS stack in the AWS environment based on a modified nested stack AWS template.
- 20 . The computer readable medium of claim 18 wherein interacting with the AWS provisioning service to import the nested AWS stack within the root AWS stack comprises: generating a temporary root AWS template for the root AWS stack, wherein the temporary root AWS template specifies the nested stack resource that references the nested AWS stack, a list of parameters associated with the nested stack resource, and a list of tags associated with the nested stack resource; and interacting with the AWS provisioning service to update the root AWS stack in the AWS environment based on the temporary root AWS template.
Description
TECHNICAL FIELD The following disclosure relates to the field of cloud-computing platforms, and in particular, to nested stacks. BACKGROUND Cloud-computing allows users access to a variety of services over an internet connection. One example of a cloud-computing platform is Amazon Web Services (AWS). To assist in building and managing a cloud infrastructure, AWS provides a service (e.g., AWS CloudFormation) that creates and manages a collection of resources (also referred to as AWS resources). For AWS CloudFormation, for example, a user creates a template that describes resources and their associated properties, and the AWS CloudFormation service creates a stack by automatically deploying the resources described in the template. A stack comprises a collection of AWS resources that is managed as a single unit. A user can create, update, or delete the collection of resources by creating, updating, or deleting stacks. A user may deploy multiple stacks in an AWS environment. One problem occurs when a user wants to create a nested stack from an existing stack in the AWS environment. A nested stack is a stack created as part of another stack. To create a nested stack within another stack (e.g., a root stack), the template for the root stack references the nested stack with a nested stack resource (e.g., AWS::CloudFormation::Stack). However, an error may occur when attempting to import the existing stack into the root stack. SUMMARY Embodiments described herein provide an automated process of moving one or more existing stacks in an AWS environment into another stack. As an overview, a system as described herein receives a root template for a root stack that is deployed or will be deployed in the AWS environment. The system identifies one or more existing stacks that are referenced in the root template as nested stacks, and updates the existing stacks in the AWS environment to preclude parameters from being assigned default values. The system then imports the updated existing stacks into the root stack. One technical benefit is existing stacks in the AWS environment can be moved to another stack in an automated fashion while avoiding error scenarios. One embodiment comprises a stack nesting system comprising at least one processor and memory. The processor causes the stack nesting system to obtain a root template that describes a root stack in an AWS environment, identify a nested stack existing in the AWS environment that is referenced in the root template, interact with an AWS provisioning service to update the nested stack to preclude default values assigned to parameters of the nested stack, and interact with the AWS provisioning service to import the nested stack within the root stack in the AWS environment. One embodiment comprises a method of moving one or more existing stacks into a root stack. The method comprises obtaining a root template that describes the root stack in an AWS environment, identifying a nested stack existing in the AWS environment that is referenced in the root template, interacting with an AWS provisioning service to update the nested stack to preclude default values assigned to parameters of the nested stack, and interacting with the AWS provisioning service to import the nested stack within the root stack in the AWS environment. Other embodiments may include computer readable media, other systems, or other methods as described below. The above summary provides a basic understanding of some aspects of the specification. This summary is not an extensive overview of the specification. It is intended to neither identify key or critical elements of the specification nor delineate any scope particular embodiments of the specification, or any scope of the claims. Its sole purpose is to present some concepts of the specification in a simplified form as a prelude to the more detailed description that is presented later. DESCRIPTION OF THE DRAWINGS Some embodiments of the present disclosure are now described, by way of example only, and with reference to the accompanying drawings. The same reference number represents the same element or the same type of element on all drawings. FIG. 1 illustrates an AWS environment. FIG. 2 illustrates the anatomy of a template. FIG. 3 illustrates nesting of stacks. FIG. 4 illustrates an error scenario for an AWS provisioning service. FIG. 5 illustrates an AWS environment in an illustrative embodiment. FIG. 6 is a block diagram of a stack nesting system in an illustrative embodiment. FIG. 7 is a flow chart illustrating a method of moving one or more existing stacks into a root stack in an illustrative embodiment. FIG. 8 illustrates a root template in an illustrative embodiment. FIG. 9 is a flow chart illustrating a method of updating a nested stack in an illustrative embodiment. FIG. 10 illustrates a nested stack template in an illustrative embodiment. FIGS. 11-12 illustrate modified nested stack templates in illustrative embodiments. FIG. 13 is a flow chart il