YAML for Terraform Plan
Run terraform/tofu init and plan in a Docker container, then render a structured plan diff (add/update/destroy/replace).
YAML examples for Terraform Plan
Terraform Plan
yaml
- action: "Terraform Plan"
type: "TERRAFORM_PLAN"
tool: "OPENTOFU"
version: "1.9.0"
Terraform Plan with arguments
yaml
- action: "Terraform Plan"
type: "TERRAFORM_PLAN"
tool: "OPENTOFU"
version: "1.9.0"
working_directory: "./infrastructure/prod"
tf_workspace: "production"
additional_args: "-var-file=prod.tfvars -parallelism=20"
Terraform Plan with custom binary
yaml
- action: "Terraform Plan"
type: "TERRAFORM_PLAN"
tool: "CUSTOM"
custom_binary_path: "/opt/terraform/bin/terraform"
docker_image_name: "mycompany/terraform-runner"
docker_image_tag: "1.9.5"
working_directory: "./infrastructure/prod"
Terraform Plan with custom image from a private registry
yaml
- action: "Terraform Plan"
type: "TERRAFORM_PLAN"
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"
Terraform Plan with state in a Buddy artifact
yaml
- action: "Terraform Plan"
type: "TERRAFORM_PLAN"
tool: "OPENTOFU"
version: "1.9.0"
working_directory: "./infrastructure/prod"
backend:
type: "ARTIFACT"
artifact: "terraform-state"
artifact_version: "1.0.0"
Terraform Plan with state in Amazon S3
yaml
- action: "Terraform Plan"
type: "TERRAFORM_PLAN"
tool: "OPENTOFU"
version: "1.9.0"
working_directory: "./infrastructure/prod"
backend:
type: "AMAZON"
integration: "amazon-web-services"
region: "us-east-1"
Terraform Plan with custom image from Amazon ECR
yaml
- action: "Terraform Plan"
type: "TERRAFORM_PLAN"
tool: "CUSTOM"
custom_binary_path: "/usr/local/bin/terraform"
docker_image_name: "terraform-runner"
docker_image_tag: "1.9.5"
image_location: "PRIVATE_REGISTRY"
docker_registry: "AMAZON_ECR"
region: "us-east-1"
integration: "my_integration"
working_directory: "./infrastructure/prod"