Comparison of infrastructure as code frameworks from a developer perspective

University essay from Linköpings universitet/Institutionen för datavetenskap

Author: Daniel Karlsson; [2023]

Keywords: ;

Abstract: The cloud has become much more important and relevant to the IT industry in recentyears. Instead of buying and maintaining their own physical servers, companies now often opt for renting servers and services from cloud providers. These servers can be thought ofas abstract units of computing power that can be dynamically allocated or disposed of de-pending on need. Configuring such an infrastructure can be very complex and challenging.This is where Infrastructure as Code (IaC) comes into play. Instead of having to manually create and configure each resource and their web of con-nections, IaC can be used to describe the desired state of the infrastructure in a declarativeway as code. The IaC tools will then take care of creating and configuring the resources inthe cloud to match that desired state. There exists quite a few different IaC tools. This thesis will go through the IaC toolsAWS CDK and Pulumi and compare them to provide you with insight to help you choosewhich tool will fit you best. The focus will lie on the readability aspect of the tools. This comparison was done by implementing a specific infrastructure using each ofthe tools and then comparing the implementations using a survey where people voted onwhich one they preferred as well as by using the metrics: Lines of Code (LOC), CyclomaticComplexity (CC) and Cognitive Complexity (COG). The survey results showed that AWS CDK was generally preferred in terms of read-ability due to higher level abstractions and nicely provided resource defaults. However,Pulumi’s way of configuring stack specific variables using dedicated YAML files was pre-ferred as well as declaring the resources at the level, compared to inside a class as in AWSCDK. AWS CDK also had a better metrics score when looking at LOC and Cognitive Com-plexity, where Pulumi had a better CC score. The command line interface (CLI) of the tools were also briefly evaluated to see if theyfollowed some of the recommended guidelines. Both AWS CDK and Pulumi followed mostof the guidelines. However, neither used stdout and stderr correctly and Pulumi did nothave an explicit flag for extracting the current CLI version.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)