IMPLEMENTATION AND ANALYSIS OF TERRAFORM BASED CI/CD PIPELINES: a Comparison between Terraform HCL and CDK Terrain
Arsia, Perham (2026)
Arsia, Perham
2026
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2026052215478
https://urn.fi/URN:NBN:fi:amk-2026052215478
Tiivistelmä
The thesis compares declarative and programmatic approaches to Infrastructure as Code (IaC) by evaluating Terraform using HashiCorp Configuration Language (HCL) and CDK Terrain implemented in Java within a CI/CD environment. A prototype infrastructure was developed for both approaches and integrated into a pull request-driven pipeline using GitHub Actions and Atlantis. The implementations were analysed through comparative observation, focusing on workflow structure, validation, error handling and tooling integration.
Both approaches successfully provisioned infrastructure and supported CI/CD workflows. Terraform HCL provided a direct and straightforward process, while CDK Terrain introduced additional steps through compilation and synthesis. Although this enabled greater flexibility and broader tooling support, it also increased the complexity and integration effort. The results indicate that declarative IaC (Terraform HCL) is more efficient for smaller scale, standard workflows, while programmatic IaC (CDK Terrain) is better suited for scenarios requiring higher levels of abstraction and scalability.
Both approaches successfully provisioned infrastructure and supported CI/CD workflows. Terraform HCL provided a direct and straightforward process, while CDK Terrain introduced additional steps through compilation and synthesis. Although this enabled greater flexibility and broader tooling support, it also increased the complexity and integration effort. The results indicate that declarative IaC (Terraform HCL) is more efficient for smaller scale, standard workflows, while programmatic IaC (CDK Terrain) is better suited for scenarios requiring higher levels of abstraction and scalability.
