YAML for Terraform Apply
Run terraform/tofu apply on a plan file produced by a preceding Terraform Plan action in the same pipeline run.
YAML examples for Terraform Apply
Terraform Apply
yaml
- action: "Terraform Apply"
type: "TERRAFORM_APPLY"
tool: "OPENTOFU"
version: "1.9.0"
Terraform Apply with explicit plan file
yaml
- action: "Terraform Apply"
type: "TERRAFORM_APPLY"
tool: "OPENTOFU"
version: "1.9.0"
working_directory: "./infrastructure/prod"
tf_workspace: "production"
plan_file_path: "$BUDDY_ACTION_TF_PLAN_OUTPUT_FILE"
additional_args: "-parallelism=20"
Terraform Apply with state in a Buddy artifact
yaml
- action: "Terraform Apply"
type: "TERRAFORM_APPLY"
tool: "OPENTOFU"
version: "1.9.0"
working_directory: "./infrastructure/prod"
backend:
type: "ARTIFACT"
artifact: "terraform-state"
artifact_version: "1.0.0"
Terraform Apply with custom image from a private registry
yaml
- action: "Terraform Apply"
type: "TERRAFORM_APPLY"
tool: "CUSTOM"
custom_binary_path: "/usr/local/bin/tofu"
docker_image_name: "mycompany/terraform-runner"
docker_image_tag: "1.9.5"
image_location: "PRIVATE_REGISTRY"
docker_registry: "OTHER"
registry: "my.registry.com"
login: "buddyworks"
password: "${top_secret_password}"
working_directory: "./infrastructure/prod"