Update Terraform workflows and dependencies.
Update Terraform workflows and dependencies.
Change Summary
This commit introduces several significant changes to the project’s infrastructure-as-code (IaC) workflows and configurations. Key updates include the addition of new GitHub Actions workflows for deploying and planning Terraform configurations using Terragrunt, modifications to HCL and Terraform files for improved provider configurations, and updates to tool versions in mise.toml.
Technical Details
- New GitHub Actions Workflows:
deploy.yml: Automates the deployment of Terragrunt configurations. It includes steps for checking out the code, validating HCL files, installing Terragrunt and OpenTofu, configuring AWS credentials, and executing theterragrunt applycommand.plan.yml: Automates the planning phase of Terragrunt configurations. Similar todeploy.yml, it checks out the code, validates HCL files, installs necessary tools, configures AWS credentials, and runs theterragrunt plancommand.
- HCL and Terraform Changes:
metrics.hcl: Includes a newkube_providerconfiguration.helm.hclandkube.hcl: Updated to usepathexpandfor theconfig_pathto ensure compatibility across different environments.main.tfin themetricsmodule: Downgraded themetrics-serverHelm chart version from 3.13 to 3.12.2.- Multiple
.terraform.lock.hclfiles across different modules: Updated the version of the Argo CD provider from 7.12.3 to 7.12.4.
- Tool Versions:
mise.toml: Specified versions for Terragrunt (0.96.1) and OpenTofu (1.11.2).
Key Learnings & Insights
- Automation and CI/CD: The introduction of GitHub Actions workflows (
deploy.ymlandplan.yml) demonstrates a shift towards automating infrastructure deployment and planning processes. This approach enhances reliability and reduces manual intervention. - Configuration Management: The changes in HCL and Terraform files, particularly the use of
pathexpand, showcase best practices in configuration management. This ensures that paths are correctly resolved in different environments, improving portability and maintainability. - Version Management: Specifying tool versions in
mise.tomlensures consistency across development and production environments, reducing the risk of version-related issues.
Impact Assessment
- System Reliability: Automating deployment and planning processes with GitHub Actions improves the reliability and consistency of infrastructure changes.
- Maintainability: The use of
pathexpandand specified tool versions enhances the maintainability of the codebase by reducing environment-specific issues and ensuring consistent tool versions. - Performance and Security: Downgrading the
metrics-serverHelm chart version might impact performance or features. It’s essential to monitor the system post-deployment for any adverse effects.
Developer Notes
- Gotchas: Ensure that AWS credentials and Tailscale auth keys are correctly set up in GitHub Secrets to avoid authentication issues during workflow execution.
- Future Improvements: Consider adding additional checks or validations in the GitHub Actions workflows to further enhance the deployment process. Exploring the use of Terragrunt’s experimental features could also provide additional benefits.
This post is licensed under CC BY 4.0 by the author.