Terraform and GitHub Actions Updates.
Change Summary
This update introduces significant changes to the CI/CD pipeline for deploying and planning infrastructure using Terragrunt and OpenTofu. Two new GitHub Actions workflows (deploy.yml and plan.yml) have been added, along with updates to Terraform configurations and dependencies.
Technical Details
- New Workflows:
deploy.yml: Automates the deployment process using Terragrunt. It includes steps for checking out the code, validating HCL files, configuring AWS credentials, setting up Tailscale, and applying Terragrunt configurations.plan.yml: Automates the planning process for pull requests. It follows a similar structure todeploy.ymlbut generates a plan instead of applying changes.
- Terraform Configurations:
- Added
kube_providerinclusion inmetrics.hcl. - Updated
helm.hclandkube.hclto usepathexpandforconfig_path. - Changed the version of the
metrics-serverHelm chart from3.13to3.12.2inmain.tf.
- Added
- Dependency Updates:
- Updated the version of the Argo CD provider from
7.12.3to7.12.4across multiple.terraform.lock.hclfiles. - Added
mise.tomlto manage tool versions, specifying Terragrunt0.96.1and OpenTofu1.11.2.
- Updated the version of the Argo CD provider from
Key Learnings & Insights
Automation of CI/CD Processes: The introduction of
deploy.ymlandplan.ymlworkflows demonstrates a best practice in automating infrastructure deployment and planning. This reduces manual intervention and ensures consistency across environments.Version Management: The use of
mise.tomlfor tool version management ensures that the development and CI environments use consistent tool versions, reducing potential compatibility issues.Path Management: The switch to
pathexpandinhelm.hclandkube.hclenhances portability and ensures that paths are correctly resolved across different environments.
Impact Assessment
Performance: The changes are unlikely to have a direct performance impact but will streamline the deployment and planning processes, leading to more efficient infrastructure management.
Security: Configuring AWS credentials and managing sensitive information through GitHub Secrets enhances security by centralizing and securing access to critical resources.
Maintainability: The automation of deployment and planning processes, along with consistent tool version management, improves maintainability and reduces the risk of configuration drift.
Developer Notes
Gotchas: Ensure that all necessary secrets (e.g.,
TS_AUTH_KEY,KUBE_CONFIG) are properly set up in the GitHub repository settings to avoid workflow failures.Edge Cases: Monitor the first few deployments closely to ensure that the new workflows and configurations work as expected across all environments.
Future Improvements: Consider adding additional checks or validations within the workflows to further enhance the reliability and security of the deployment process.