Terraform Workflows Update and Fixes
Change Summary
This commit introduces two new GitHub Actions workflows for deploying and planning infrastructure changes using Terragrunt. It also updates various HCL and Terraform files to include new providers and configurations, and bumps the versions of certain dependencies. Additionally, a new mise.toml file is added to manage tool versions.
Technical Details
- Workflows:
.github/workflows/deploy.yml: This workflow triggers onworkflow_dispatchandpushevents to themainbranch. It performs checks on Terragrunt HCL files and then deploys the infrastructure..github/workflows/plan.yml: This workflow triggers onworkflow_dispatchand variouspull_requestevents. It also checks Terragrunt HCL files and then plans the infrastructure changes.
- HCL and Terraform Files:
IaC/_envcommon/metrics.hcl: Includes a newkube_provider.IaC/_envcommon/providers/helm.hclandIaC/_envcommon/providers/kube.hcl: Updates theconfig_pathto usepathexpand.IaC/modules/metrics/main.tf: Changes the version of themetrics-serverHelm chart.- Multiple
.terraform.lock.hclfiles: Updates the version of the Argo CD provider from7.12.3to7.12.4.
- Dependency Management:
mise.toml: Added to manage versions ofterragruntandopentofu.
Key Learnings & Insights
- Automation and CI/CD: The introduction of GitHub Actions workflows for deploying and planning infrastructure changes automates the process, ensuring consistency and reducing manual errors.
- Version Management: Using
mise.tomlto manage tool versions centralizes dependency management, making it easier to update and maintain tool versions across the project. - Path Expansion: The use of
pathexpandin HCL files ensures that paths are correctly resolved, which is crucial for cross-platform compatibility and avoiding hardcoded paths.
Impact Assessment
- Automation: The new workflows streamline the deployment and planning processes, reducing the likelihood of human error and ensuring that infrastructure changes are consistently applied.
- Maintainability: Centralized version management via
mise.tomlsimplifies updates and ensures that all developers are using the same tool versions. - Compatibility: The use of
pathexpandenhances the portability of configurations across different environments.
Developer Notes
- Workflow Dependencies: Ensure that the necessary secrets (
TS_AUTH_KEYandKUBE_CONFIG) are correctly set up in the GitHub repository settings. - Version Updates: When updating tool versions in
mise.toml, verify that the new versions are compatible with the existing infrastructure and workflows. - Path Resolution: Be cautious when modifying paths in HCL files to ensure that
pathexpandis used correctly to avoid path resolution issues.
This post is licensed under CC BY 4.0 by the author.