Skip to main content
Tools

Terraform .gitignore

.gitignore for tools projects

View on GitHub

.gitignore Content

# ============================================================================
# Created by https://gitignores.com/
# TOOL-SPECIFIC TEMPLATE for Terraform
# Website: https://www.terraform.io/
# Repository: https://github.com/ronald2wing/.gitignores
# ============================================================================

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE OVERVIEW & USAGE NOTES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# • TEMPLATE TYPE: TOOL-SPECIFIC TEMPLATE
# • PURPOSE: Terraform-specific patterns for configuration, cache, logs, and development artifacts
# • DESIGN PHILOSOPHY: Tool-specific patterns for development and deployment workflows
# • COMBINATION GUIDANCE: Combine with language templates for specific development workflows
# • SECURITY CONSIDERATIONS: Does not include security patterns - combine with common/security.gitignore
# • BEST PRACTICES: Combine with appropriate language and security templates, test with your development workflow, review for tool version compatibility
# • OFFICIAL SOURCES: Terraform Tool official documentation, community guidelines, and integration best practices

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEPENDENCY MANAGEMENT & PACKAGE CACHE
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

.terraform/environment

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEVELOPMENT & RUNTIME ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

.terragrunt-cache/
crash.log

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# TOOL-SPECIFIC PATTERNS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

**/.terraform/*
*.tfplan
*.tfstate
*.tfstate.*
*.tfvars
*.tfvars.json
*_override.tf
*_override.tf.json
.terraform.lock.hcl
.terraform/providers/
.terraformrc
backend.tf
override.tf
override.tf.json
terraform.rc

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE CUSTOMIZATION & BEST PRACTICES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 1. REVIEW: Examine all patterns before use
# 2. CUSTOMIZE: Adapt to your project's specific structure
# 3. TEST: Use `git check-ignore` to verify patterns work correctly
# 4. SECURE: Always protect sensitive data and credentials
# 5. UPDATE: Review periodically as technology evolves

# Combine with language or framework templates as needed:

# EXAMPLE COMBINATION:
# cat languages/python.gitignore \
#     common/security.gitignore \
#     tools/terraform.gitignore \
#     common/cache.gitignore > .gitignore

Note: This file is fetched from GitHub and cached for 7 days.