Member post originally published on AppCD’s blog by Kunal Dabir
I was recently speaking with an SRE who, when asked for their opinion on Infrastructure as Code (IaC), shouted, “it’s terrible and our devs hate it!” Now we may have been discussing a particular company, but the overall takeaway is that IaC isn’t always easy, especially for developers who have to learn it on top of the job they were hired to do. This particular SRE spent a lot of his time auditing and fixing IaC for devs. IaC is for sure a great option for code-driven infrastructure, but its complexity requires expertise; expertise that isn’t always available.
So when I was thinking about the needs of the developer community, I was interested to see that “explain infrastructure as code” is one of Google’s autocomplete suggestions. Increasingly, developers are being asked to not just write application code, but also to do the work necessary to get that application deployed. Which more often than not requires cloud infrastructure, once again putting yet another requirement on developers to provision that too.
But developers aren’t always fans (we hear you!) for a number of reasons:
- Complexity and Learning Curve: IaC can be complex and has a steep learning curve, especially for those new to infrastructure as code (IaC). Specifically, the HCL (HashiCorp Configuration Language) syntax and the need to understand various Terraform concepts can be daunting.
- State Management: Managing state can be tricky and error-prone. The state file is a critical part of IaC’s operation, and if it becomes corrupted or is mishandled, it can cause significant issues especially as some tools (like Terraform) require state files.
- Debugging Difficulties: Debugging IaC configurations can be challenging. Error messages may not always be clear or helpful, making it hard to identify and fix issues.
- Lack of Idempotency: While most IaC providers aim to be idempotent, ensuring that the same code always produces the same result, there are cases where it can lead to unexpected changes or require manual intervention. Check out this AWS blog for more info on Idempotency.
- Dependency Management: Handling dependencies between resources can be complex and lead to issues like circular dependencies, which can be difficult to resolve.
- Performance Issues: For large infrastructures, IaC can be slow, and plan or apply operations might take considerable time, reducing productivity.
- Limited Language Features: Compared to general-purpose programming languages, IaC can have limited features, making it difficult to express complex logic or configurations. While some IaC options can be written in programming languages, most use declarative or configuration langues like HCL, JSON or YAML which are limited in features.
- Provider Limitations: The quality and feature set of IaC providers can vary. If a provider is not well-maintained or lacks support for specific features, it can limit what developers can achieve.
- Preference for Alternatives: There are many Infrastructure as Code solutions like Terraform, AWS CloudFormation, Pulumi, or Kubernetes-native tools, which some might prefer over others and be easier to integrate into their workflows.
Alternatives to Infrastructure as Code
Developer infrastructure tools are necessary – we all know that. But we need to make it as easy as possible, i.e. abstract away tooling and expertise where possible so that a developer doesn’t need to be a DevOps expert in addition to an app-expert. Infrastructure as Code, while revolutionary in many ways, often falls short. IaC tends to prioritize the infrastructure layer, sometimes at the expense of the application’s unique requirements. This can lead to scenarios where the infrastructure dictates the application’s architecture, rather than the other way around. The result is a less efficient, less optimized system that may not fully leverage the application’s strengths (while annoying developers because the app doesn’t run the way it should!).
Keep reading
- You don’t want a visualization of your IaC
- Find IaC missteps
- Use Terrastest to test your IaC
- Register for KubeCon + CloudNativeCon North America 2024 today
This is where Infrastructure from Code comes in. By auto-generating IaC based on the application source code, developers can focus on their core application development tasks without getting bogged down by the complexities of infrastructure management.
Infrastructure from Code is a compelling alternative to IaC because it abstracts away IaC from the software development lifecycle removing the requirement for developers to be infrastructure experts. (It also means infrastructure experts avoid spending hours fixing IaC for devs).
The Appeal of Infrastructure from Code
Templates often attempt to offer one-size-fits-all solutions, which can be limiting and inflexible. They might be useful in some contexts, but they can also hinder creativity and adaptability.
Infrastructure from Code offers quick, concise IaC that can significantly streamline workflows. Unlike using fill in the blank templates, which can be cumbersome and rigid, Infrastructure from Code analyzes what has already been coded to create IaC that is application-centric i.e. infrastructure provisioned for that application. Being application-centric means focusing on the specific needs and characteristics of the application rather than forcing it to fit into a predetermined infrastructure model. This approach allows for greater flexibility and optimization, as the infrastructure is tailored to support the application most effectively.
With Infrastructure from Code, devs can ensure standards are automatically applied based on best practices around security, reliability and provisioning. These can be industry-accepted best practices or even organizational standards. But standards are core to Infrastructure from Code.
Rather than relying on static templates, adopting standards can be far more beneficial. Standards provide a consistent framework that can be adapted to various scenarios without the constraints of a predefined template. This approach encourages best practices and ensures that the infrastructure is robust, scalable, and secure.
Infrastructure from Code Benefits Developers
Infrastructure from Code ensures all the work already coded by a developer to define infrastructure requirements within their application code is recognized and auto-generated. Instead of putting work into your app and then having to replicate it in IaC using templates, this method ensures that the infrastructure is tailored to the application’s needs, providing a more seamless and efficient workflow.
Infrastructure from Code offers several benefits to developers:
- Simplicity: By analyzing static code to generate IaC automatically, developers can get their infrastructure provisioned faster – meaning features/apps get to market faster (and often without wait times).
- Efficiency: Infrastructure from Code minimizes the need for extensive DevOps knowledge, allowing developers to focus on their core competencies.
- Consistency: Standards-based approaches in Infrastructure from Code ensure that infrastructure is reliable and scalable, adapting to various application needs without rigid templates.
Take control of your infrastructure without becoming an expert in a different domain. This streamlined approach reduces cognitive load and allows for more creativity and innovation in application development.
Infrastructure from Code is the future of IaC. You can explore Infrastructure from Code and see how it can transform your development process at appCD.