Skip to content

epycloud terraform

Manage Google Cloud infrastructure with Terraform.

Usage

epycloud terraform SUBCOMMAND [OPTIONS]
epycloud tf SUBCOMMAND [OPTIONS]  # Short alias

Description

Manages Google Cloud infrastructure resources using Terraform. Provides a wrapper around Terraform commands with environment-aware configuration and safety checks. Commands automatically use the appropriate Terraform workspace and variable files based on the active environment.

Subcommands

init

Initialize Terraform working directory.

epycloud terraform init

Downloads providers, configures remote backend (GCS), and prepares directory.

plan

Preview infrastructure changes without applying.

epycloud terraform plan [OPTIONS]

Options: - --target RESOURCE - Plan changes for specific resource only - --out FILE - Save plan to file

apply

Apply infrastructure changes.

epycloud terraform apply [OPTIONS]

Options: - --auto-approve - Skip interactive approval prompt - --target RESOURCE - Apply changes to specific resource only

destroy

Destroy all managed infrastructure.

epycloud terraform destroy [OPTIONS]

Options: - --auto-approve - Skip interactive approval prompt - --target RESOURCE - Destroy specific resource only

Destructive Operation

This permanently deletes cloud resources and data. Always verify environment before destroying.

output

Display Terraform output values.

epycloud terraform output [NAME]

Examples

# Initialize Terraform
epycloud tf init

# Preview changes
epycloud tf plan

# Apply changes
epycloud tf apply

# Apply without confirmation
epycloud tf apply --auto-approve

# Apply to production
epycloud --env prod tf apply

# Apply specific resource
epycloud tf apply --target google_workflows_workflow.pipeline

# Show all outputs
epycloud tf output

# Show specific output
epycloud tf output bucket_name

# Destroy all resources
epycloud tf destroy

# Destroy dev environment
epycloud --env dev tf destroy

Exit Codes

Code Description
0 Success
1 Error (validation failed, apply failed)
2 Plan shows changes (with -detailed-exitcode)

See Also