Automated nesting of existing stacks in a root stack within an AWS environment
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.
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.