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 = "git@github.com:fourplusone/tf-target.git"
author_name = "Matthias Bartelmeß - Terraform"
author_email = "mba@fourplusone.de"
}
Resource
The following arguments are supported:
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"
}