Skip to content

Conversation

Copy link

Copilot AI commented Dec 9, 2025

Terraform variable files (*.tfvars) typically contain sensitive credentials like API keys and service principals but were not ignored, risking accidental commits of secrets.

Changes

  • Added *.tfvars to .gitignore to exclude all Terraform variable files
  • Added !*.tfvars.example exception to preserve template files for developer reference
# Terraform variable files (keep example files)
*.tfvars
!*.tfvars.example

This prevents future sensitive data leakage while maintaining example configurations. Note: existing tracked *.tfvars files remain in history and must be removed separately if needed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add .gitignore rule for Terraform variable files to prevent sensitive data leakage</issue_title>
<issue_description>## Problem Description

The current .gitignore file is missing rules to ignore Terraform variable files (*.tfvars). These files typically contain sensitive information such as:

  • API keys and secrets
  • Service principal credentials
  • Other sensitive configuration data

Without adding these files to .gitignore, sensitive information may be accidentally committed to the repository.

Proposed Solution

Add the following rules to the Terraform section of .gitignore:
tignore

Terraform variable files (keep example files)

.tfvars
!
.tfvars.exampleThis rule will:

  • ✅ Ignore all *.tfvars files (containing sensitive information)
  • ✅ Keep *.tfvars.example files (as templates for other developers)
    </issue_description>

<agent_instructions>Please add a .gitignore file and replace any existing unreasonable files.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add .gitignore rule for Terraform variable files Add .gitignore rules for Terraform variable files Dec 9, 2025
Copilot AI requested a review from johnluoyx December 9, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add .gitignore rule for Terraform variable files to prevent sensitive data leakage

2 participants