Customize Your Plan and Apply Workflows in Terraform with Terrateam
On this page
Oftentimes organizations need to run more than just a terraform plan
and terraform apply
. Teams need automated security checks, compliance validations, ways to execute custom scripts integrated into their IaC workflows to satisfy all kinds of different requirements and ensure consistent deployments. Terrateam provides a flexible way to satisfy these requirements directly within GitHub pull requests.
Building Custom Terraform Workflows
Terrateam enhances Terraform operations with customizable workflows defined in the .terrateam/config.yml
file. These workflows control how Terraform executes plan and apply changes while also integrating additional steps for validation, automation, and customization.
The workflow configuration follows a hierarchy:
Tag queries determine when a specific workflow is triggered. This allows for different configurations for specific environments. Terrateam supports multiple workflows with different tag queries, providing granular control over infrastructure changes.
Terrateam offers many step types for workflow customization:
- The
run
step executes custom commands - The
env
step manages environment variables - The
oidc
step implements secure cloud authentication
Implementing Custom Scripts and Validation
Custom workflows in Terrateam allow teams to add security checks, compliance validation, and integrations with external systems.
Security scanning tools like terrascan integrate directly into a pre-plan workflow step to detect potential misconfigurations:
Automating Pre and Post-Apply Actions
Pre-apply and post-apply steps can automate critical tasks around Terraform apply operations. These custom workflow steps can integrate infrastructure changes with external systems:
Custom workflows include strong error handling to maintain reliability. When a custom step fails, Terrateam aborts the workflow and provides detailed error messages in pull request comments:
Securing Multi-Cloud Deployments
OpenID Connect (OIDC) integration removes the need for unsafe static credentials by generating temporary authentication tokens. This method supports multiple cloud providers within a single workflow:
Environment-specific workflow configurations allow teams to define specific permissions and controls through directory-based tag queries:
Building Better Infrastructure Workflows
Terrateam enables teams to create powerful Terraform workflows. With the Terrateam configuration file, it’s easy to implement custom validations, automate notifications, and create sophisticated multi-step workflows. Start improving your infrastructure workflows today by integrating Terrateam with your GitHub repository. Visit the Terrateam documentation for our quickstart guide.