Management of Environments Using Pipelines

One of the best ways to determine the server based infrastructure for implementing software is by using tools like Terraform, Heat and Cloud Formation. Modification, provision configuration and restructuring of an environment should be confined in a way that is transparent, repetitive and testable. By using it in an appropriate manner the above tools will give us the confidence to make changes, make adjustments and to restructure our infrastructure in simple, easy and comfortable way.

After using the above tools most of us will experience some drawbacks. Automation tool that easily fixes sprawling infrastructure can also roll out the crock-up easily. Have you come across a corrupted file on a server like /etc/hosts during your non-production process? Making it impossible to handle the error or to fix it or even to run the tool again? I have come across it.

A Better way is necessary to test and to make an alteration safely before using them in environments that you care so much about. Software delivery 101 is always used to test a new feature in an environment before deploying it into the real environment to live. In order to structure your infrastructure code in a best possible way it is not necessary to follow the above method.

There are various methods to achieve this. One such method is usage of separate stack, which helps explain and define each individual environment. Another strategy is to put everything about the environment in one stack. People use different methods – to do it which I am mentioning it over here. Finally, you may create and promote a single stack, with the use of pipeline.

If you look at the methods stated above, the first method is not at all good, the second method performs well only for simple setups like for two or three environments. This method is rarely used by the people, and the last method works well for large and complex processes.

Definitions

Before moving ahead, let us see the definition that I use:

Stack – Set of infrastructure that are defined and managed as a unit is referred as Stack. The stack will map directly to AWS CloudFormation stack and also sets our infrastructure to Terraform state file. Stack Definition is referred as a file or a set of file that is used to create a stack. The stack definition can be a folder consisting a group of files of Terraform files with the extension *.tf or may include a folder with template files for CloudFormation

There are more environments that are used by teams like development, UAT, Performance, QA, dynamic infrastructure platform, but for the sake of simplicity, I will be using only two environments namely Staging and Production the concept remains the same in all environments.

All Environments into a single stack

This approach is one of the simplest and easy to implement approach used by most of the people to get started. Yet,it is also a problematic one. All the environments starting from development phase to production phase are defined in a single stack definition. The environment phases are created and managed as a single stack instance

Conclusion:

There are different methods that are used by people, but pipelines infrastructure is the best method to use for the environment. The approach guarantees that changes are applied to each and every environment and they have passed the test automatically. The pipeline method is more flexible. The developers can develop their own sandbox instances which will help them to easily deploy and test the cloud based applications. The pipeline approach allows teams to make changes to their environment definition without disturbing other team members. Environments can be created easily and whenever needed by testers, reviewers and other people.

Cloud

Management of Environments Using Pipelines

January 4, 2019

Get in Touch

to learn more and see how we can help you.

Srimay Mohanty

Senior Engineer

Monthly Newsletter