Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fourplusone/terraform-provider-git

Terraform provider to write git repositories
https://github.com/fourplusone/terraform-provider-git

terraform terraform-provider

Last synced: 23 days ago
JSON representation

Terraform provider to write git repositories

Awesome Lists containing this project

README

        

# terraform-provider-git

__[Support this project on Patreon](https://www.patreon.com/fourplusone)__

[![Build Status](https://travis-ci.com/fourplusone/terraform-provider-git.svg?token=Uozu8nkCaipWW1259XXD&branch=master)](https://travis-ci.com/fourplusone/terraform-provider-git)

## Rationale

Keep your git repositories in sync with your infrastructure.

## Install

* Download `terraform-provider-git` binary from [Github](https://github.com/fourplusone/terraform-provider-git/releases)
* Unzip the zip file
* Then move `terraform-provider-git` binary to `$HOME/.terraform.d/plugins` directory

```bash
mkdir -p $HOME/.terraform.d/plugins
mv terraform-provider-git $HOME/.terraform.d/plugins/terraform-provider-git
```

* Run `terraform init` in your terraform project

```bash
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

```hcl
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

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