Create GitHub workflows for Terragrunt deployment.
Create GitHub workflows for Terragrunt deployment.
Change Summary
This commit introduces two new GitHub Actions workflows for deploying and planning infrastructure using Terragrunt. Additionally, it updates the mise.toml configuration file to specify the versions of terragrunt and opentofu.
Technical Details
- New Workflows:
.github/workflows/deploy.yml:- Triggered by
workflow_dispatchandpushevents on themainbranch. - Includes jobs for checking Terragrunt HCL syntax and deploying infrastructure.
- Triggered by
.github/workflows/plan.yml:- Triggered by
workflow_dispatchand variouspull_requestevents on themainbranch. - Includes jobs for checking Terragrunt HCL syntax and planning infrastructure changes.
- Triggered by
- Configuration:
- Both workflows configure AWS credentials and use Tailscale for secure access.
- The
mise.tomlfile is updated to pinterragruntto version0.91.1andopentofuto version1.11.1.
Key Learnings & Insights
- Automation Benefits: Implementing automated workflows for deployment and planning enhances reliability and reduces manual errors.
- Version Pinning: Specifying exact versions for
terragruntandopentofuensures consistency across environments. - Security Practices: Using GitHub Secrets for sensitive information like OAuth credentials improves security.
Impact Assessment
- Efficiency: Automated workflows streamline the deployment and planning processes, saving time and effort.
- Consistency: Version pinning in
mise.tomlensures that all team members use the same tool versions, reducing compatibility issues. - Security: Proper handling of sensitive information through GitHub Secrets mitigates security risks.
Developer Notes
- Workflow Dependencies: Ensure that the
IaC/production/homelabdirectory contains the correct Terragrunt configuration. - Environment Variables: Confirm that all required secrets (
TS_OAUTH_CLIENT_ID,TS_OAUTH_SECRET) are set in the GitHub repository settings. - Future Improvements: Consider adding notifications for workflow success or failure to keep the team informed.
This post is licensed under CC BY 4.0 by the author.