Skip to content

Terraform provider to write git repositories

License

Notifications You must be signed in to change notification settings

fourplusone/terraform-provider-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-provider-git

Support this project on Patreon

Build Status

Rationale

Keep your git repositories in sync with your infrastructure.

Install

  • Download terraform-provider-git binary from Github
  • Unzip the zip file
  • Then move terraform-provider-git binary to $HOME/.terraform.d/plugins directory
mkdir -p $HOME/.terraform.d/plugins
mv terraform-provider-git $HOME/.terraform.d/plugins/terraform-provider-git
  • Run terraform init in your terraform project
terraform init

Configuration

  • repository_url - (Required) The URL of the remote repository
  • author_name - (Optional) Name of the committer
  • author_email - (Optional) Email of the committer

Configuration Example

provider "git" {
    repository_url = "[email protected]:fourplusone/tf-target.git"
    author_name = "Matthias Bartelmeß - Terraform"
    author_email = "[email protected]"
}

Resource

The following arguments are supported:

  • content - (Required) The content of file to create.

  • filename - (Required) The path of the file to create.

Any required parent directories will be created automatically, and any existing file with the given name will be overwritten.

Resource Example

resource "git_file" "demo_out_1" {
  contents = "hello"
  path = "hello/world.txt"
}