Skip to content

hawkinswinja/iac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrastructure as Code Using Terraform

Different implementations of Infra setup using terraform for IaC

Good Terraform practices

As a good practice, the following files and directories generated by terraform init should not be stored in version control:

.terraform/ Directory:

This directory contains provider plugins, modules, and other internal files specific to the local environment. These files are environment-specific and can be regenerated by running terraform init.

terraform.tfstate:

This file contains the current state of your infrastructure, including sensitive information like resource IDs, secrets, and other configuration details. It should never be committed to version control for security reasons.

terraform.tfstate.backup:

This is a backup of the state file and may also contain sensitive information. It should not be stored in version control.

.terraform.lock.hcl (optional):

While this file can be included in version control to ensure consistent provider versions across environments, some teams choose to exclude it if they prefer to manage provider versions manually.

Why Exclude These Files?

  1. Security: State files often contain sensitive data, such as access keys, passwords, and other secrets.
  2. Environment-Specific: The .terraform/ directory and its contents are specific to the local environment and can be regenerated.
  3. Consistency: Excluding these files ensures that each team member initializes their environment independently, reducing the risk of conflicts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages