Terraform-based deployment of EDP
As-code definitions of EDP clusters, so they can be deployed reliably and consistently on OTC whenever needed.
Infrastructure as Code (IaC) is the practice of managing and provisioning infrastructure through code rather than manual processes. Instead of clicking through web consoles or running one-off commands, infrastructure is defined in version-controlled files that can be executed repeatedly to produce identical environments.
This approach treats infrastructure with the same rigor as application code: it’s versioned, reviewed, tested, and deployed through automated pipelines.
Traditional infrastructure management faces several challenges:
Infrastructure as Code addresses these challenges by making infrastructure:
Declarative - Describe the desired state, not the steps to achieve it. The IaC tool handles the implementation details.
Versioned - Every infrastructure change is committed to Git, providing complete history and the ability to rollback.
Automated - Infrastructure deploys through pipelines without human intervention, eliminating manual errors.
Testable - Infrastructure changes can be validated before production deployment.
Documented - The code itself is the documentation, always current and accurate.
Reproducible - The same code produces identical infrastructure every time, across all environments.
Imperative approaches specify the exact steps: “Create a server, then install software, then configure networking.”
Declarative approaches specify the desired outcome: “I need a server with this software and network configuration.” The IaC tool determines the necessary steps.
Most modern IaC tools use the declarative approach, making them more maintainable and resilient.
IaC tools maintain a “state” - a record of what infrastructure currently exists. When you change your code and re-run the tool, it compares the desired state (your code) with the actual state (what exists) and makes only the necessary changes.
This enables:
Running the same IaC code multiple times produces the same result. If infrastructure already matches the code, the tool makes no changes. This property is called idempotency and is essential for reliable automation.
The Edge Developer Platform uses IaC extensively:
Terraform is our primary IaC tool for provisioning cloud resources. We use Terragrunt as an orchestration layer to manage multiple Terraform modules and reduce code duplication.
Our implementation includes:
We organize infrastructure into stacks - coherent bundles of related components:
Each stack is defined as code, versioned independently, and can be deployed across different environments.
Our IaC integrates with GitOps principles:
This creates an auditable, automated, and reliable deployment process.
Development, testing, and production environments are deployed from the same code. This eliminates the “works on my machine” problem at the infrastructure level.
A complete EDP environment can be provisioned in minutes rather than days. This enables:
Code review catches infrastructure errors before deployment. Automated testing validates changes. Version control enables instant rollback if problems occur.
Infrastructure configuration is explicit and discoverable in code. New team members can understand the platform by reading the repository rather than shadowing experienced operators.
Every infrastructure change is tracked in Git history with author, timestamp, and reason. This provides audit trails required for compliance and simplifies troubleshooting.
To work with EDP’s Infrastructure as Code:
Based on our experience building and operating IaC:
Version everything - All infrastructure code belongs in version control. No exceptions.
Keep it simple - Start with basic modules. Add abstraction only when duplication becomes painful.
Test before production - Deploy infrastructure changes to test environments first.
Use meaningful commit messages - Explain why changes were made, not just what changed.
Review all changes - Infrastructure changes should go through the same review process as application code.
Document assumptions - Use code comments to explain non-obvious decisions.
Manage secrets securely - Never commit credentials to version control. Use secret management tools.
Plan for drift - Regularly compare actual infrastructure with code state to detect manual changes.
Infrastructure as Code is powerful but has challenges:
Learning curve - Teams need to learn IaC tools and practices. Initial productivity may decrease.
State management complexity - State files must be stored securely and accessed by multiple team members. State corruption can cause serious issues.
Provider limitations - Not all infrastructure can be managed as code. Some resources require manual configuration.
Breaking changes - Poorly written code can destroy infrastructure. Safeguards and testing are essential.
Tool lock-in - Switching IaC tools (e.g., Terraform to Pulumi) requires rewriting infrastructure code.
Despite these challenges, the benefits far outweigh the costs for any infrastructure of meaningful complexity.
The IPCEI-CIS Edge Developer Platform requires reliable, reproducible infrastructure. Manual provisioning cannot meet these requirements at scale.
By investing in Infrastructure as Code:
Our IaC tools (infra-catalogue and infra-deploy) embody these principles and enable the platform’s reliability.
As-code definitions of EDP clusters, so they can be deployed reliably and consistently on OTC whenever needed.
Platform-level component provisioning via Stacks