Terrateam provides flexible authentication and authorization options for Terraform operations, allowing you to securely manage credentials and control access to your cloud resources. In this guide, we’ll explore advanced workflows and configurations using Terrateam’s OIDC integration, static credentials, and custom scripts for generating cloud credentials.
To use OIDC with Terrateam, you need to configure the oidc step type in your configuration. A step type defines a specific action in your workflow, such as authentication, initialization, or execution of Terraform commands.
Terrateam’s OIDC integration provides flexibility and customization options to suit your specific requirements. Here are some advanced OIDC workflows with examples:
Define multiple OIDC configurations within a single workflow to use different roles or providers for different steps.
workflows:
- tag_query: "dir:aws"
plan:
- type: oidc
provider: aws
role_arn: ${AWS_PLAN_ROLE_ARN}
- type: init
- type: plan
apply:
- type: oidc
provider: aws
role_arn: ${AWS_APPLY_ROLE_ARN}
- type: init
- type: apply
In this example, the plan steps use a different IAM role (AWS_PLAN_ROLE_ARN) compared to the apply steps (AWS_APPLY_ROLE_ARN), allowing for granular permission control.
When implementing advanced authentication and authorization workflows with Terrateam, consider the following best practices:
Principle of Least Privilege: Grant the minimum set of permissions required for each workflow or step, ensuring that credentials have access to only the necessary resources.
Secure Credential Storage: Store sensitive credentials, such as static access keys or OIDC role ARNs, securely using GitHub Secrets or a secrets management system.
Regular Credential Rotation: Implement a process to regularly rotate credentials, whether static or dynamically generated, to minimize the risk of unauthorized access.