Terraform Provider for SFTP
A Terraform Provider which adds SFTP functionality.
Building the Provider
Clone repository to:
$ mkdir -p $GOPATH/src/github.com/danitso; cd $GOPATH/src/github.com/danitso $ git clone firstname.lastname@example.org:danitso/terraform-provider-sftp
Enter the provider directory, initialize and build the provider
$ cd $GOPATH/src/github.com/danitso/terraform-provider-sftp $ make init $ make build
Using the Provider
If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run
terraform init to initialize it.
Remote File (sftp_remote_file)
allow_missing- (Optional) Whether to ignore that the file is missing. Defaults to
host- (Required) The remote host.
host_key- (Optional) The remote host's key. Defaults to an empty string.
password- (Optional) The password for the remote host. Defaults to an empty string (use
private_keyfor key based authorization).
path- (Required) The absolute path to the file.
port- (Optional) The port number for the remote host.
private_key- (Optional) The private key for the remote host. Defaults to an empty string (use
passwordfor regular password authorization).
timeout- (Optional) The connect timeout. Defaults to
triggers- (Optional) The triggers.
user- (Required) The username for the remote host.
contents- The file contents.
last_modified- The last modified timestamp of the file.
size- The file size (in bytes).
Developing the Provider
If you wish to work on the provider, you'll first need Go installed on your machine (version 1.12+ is required).
You'll also need to correctly setup a GOPATH, as well as adding
$GOPATH/bin to your
To compile the provider, run
make build. This will build the provider and put the provider binary in the
$ make build ... $ $GOPATH/bin/terraform-provider-sftp ...
If you wish to contribute to the provider, please see CONTRIBUTING.md.
Testing the Provider
In order to test the provider, you can simply run
$ make test
Tests are limited to regression tests, ensuring backwards compability.