A Terraform provider to manage files.
Go to file
github-actions[bot] 7597f07b01
chore(release/v2): release 2.0.2 (#220)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-03 17:26:59 -05:00
.github fix: goreleaser tag race condition (#188) (#191) 2025-09-19 23:27:50 -05:00
docs feat!: Add local directory management (#201) (#204) 2025-10-01 13:31:36 -05:00
examples feat!: Add local directory management (#201) (#204) 2025-10-01 13:31:36 -05:00
internal/provider fix: remove all to prevent missing file errors (#216) (#219) 2025-10-03 17:21:05 -05:00
test feat!: Add local directory management (#201) (#204) 2025-10-01 13:31:36 -05:00
tools chore(deps): bump github.com/hashicorp/terraform-plugin-docs in /tools (#194) (#215) 2025-10-02 00:26:53 -05:00
.aliases fix: move release please to release branches (#4) 2025-08-15 11:23:04 -05:00
.envrc initial 2025-08-14 12:57:49 -05:00
.functions initial 2025-08-14 12:57:49 -05:00
.gitignore initial 2025-08-14 12:57:49 -05:00
.golangci.yml feat: add data sources and organize code (#148) 2025-09-04 00:02:33 -05:00
.goreleaser.yml fix: goreleaser tag race condition (#188) (#191) 2025-09-19 23:27:50 -05:00
.goreleaser_rc.yml fix: goreleaser tag race condition (#188) (#191) 2025-09-19 23:27:50 -05:00
.rcs initial 2025-08-14 12:57:49 -05:00
.release-please-manifest.json chore(release/v2): release 2.0.2 (#220) 2025-10-03 17:26:59 -05:00
.variables initial 2025-08-14 12:57:49 -05:00
CHANGELOG.md chore(release/v2): release 2.0.2 (#220) 2025-10-03 17:26:59 -05:00
GNUmakefile feat!: Add local directory management (#201) (#204) 2025-10-01 13:31:36 -05:00
LICENSE initial 2025-08-14 12:57:49 -05:00
README.md Update readme (#175) (#178) 2025-09-19 17:27:55 -05:00
aspell_custom.txt fix: manually generate release candidate tag (#105) 2025-08-27 12:27:04 -05:00
flake.lock feat!: Add local directory management (#201) (#204) 2025-10-01 13:31:36 -05:00
flake.nix initial 2025-08-14 12:57:49 -05:00
go.mod chore(deps): bump the terraform-plugin group (#196) (#208) 2025-10-01 23:43:47 -05:00
go.sum chore(deps): bump the terraform-plugin group (#196) (#208) 2025-10-01 23:43:47 -05:00
main.go feat: add data sources and organize code (#148) 2025-09-04 00:02:33 -05:00
release-please-config.json fix: add a new workflow for release candidates (#93) 2025-08-26 15:10:22 -05:00
terraform-registry-manifest.json initial 2025-08-14 12:57:49 -05:00

README.md

Terraform Provider File

  • A resource and a data source (internal/provider/),
  • Examples (examples/) and generated documentation (docs/),
  • Miscellaneous meta files.

Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Make build command:
make build

Adding Dependencies

This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.

To add a new dependency github.com/author/dependency to your Terraform provider:

go get github.com/author/dependency
go mod tidy

Then commit the changes to go.mod and go.sum.

There are two levels of dependency, one is for the dev, test, and build environment, the other is the Go dependencies as listed above. We use Nix to manage environment dependencies. You can install Nix using their scripts: https://nixos.org/download/ After that you can enter the development environment using the "flake.nix" file in the root of the repo. Once Nix is installed source the .envrc and it should manage everything for you. If this is your first flake, you may need to initialize flakes for this directory.

To initialize flakes:

  • mv flake.nix flake.new
  • nix --extra-experimental-features flakes --extra-experimental-features nix-command flake init
  • mv flake.new flake.nix

Using the provider

# this provider has no configuration currently
provider "file" {}

resource "file_local" "basic_example" {
  name     = "example.txt"
  contents = "An example implementation writing a local file."
}

Please see the docs at https://registry.terraform.io/providers/rancher/file/latest/docs for more information.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

To generate or update documentation, run make generate.

In order to run the full suite of Unit tests, run make test.

In order to run the full suite of Acceptance tests, run make testacc.

make testacc

To build, generate, and run all tests, run make.