https://github.com/ewilde/terraform-provider-openfaas
Terraform OpenFaaS provider
https://github.com/ewilde/terraform-provider-openfaas
Last synced: 4 months ago
JSON representation
Terraform OpenFaaS provider
- Host: GitHub
- URL: https://github.com/ewilde/terraform-provider-openfaas
- Owner: ewilde
- License: mpl-2.0
- Created: 2018-09-01T14:15:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-04T15:27:50.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T15:57:31.434Z (almost 2 years ago)
- Language: Go
- Size: 29.5 MB
- Stars: 47
- Watchers: 6
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform provider for OpenFaaS
[](https://travis-ci.org/ewilde/terraform-provider-openfaas)
The terraform provider for [OpenFaaS](https://www.openfaas.com/)
## Documentation
Full documentation, see: https://openfaas-tfe.edwardwilde.com/docs/providers/openfaas
### Example Usage
```hcl
resource "openfaas_function" "function_test" {
name = "test-function"
image = "functions/alpine:latest"
f_process = "sha512sum"
labels = {
Group = "London"
Environment = "Test"
}
annotations = {
CreatedDate = "Mon Sep 3 07:15:55 BST 2018"
}
}
```
[](https://www.youtube.com/watch?v=sSctTy6YIlU&feature=youtu.be)
## Building and Installing
Since this isn't maintained by Hashicorp, you have to install it manually. There
are two main ways:
### Download a release
Download and unzip the [latest
release](https://github.com/ewilde/terraform-provider-openfaas/releases/latest).
Then, move the binary to your terraform plugins directory. [The
docs](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins)
don't fully describe where this is.
* On Mac, it's `~/.terraform.d/plugins/darwin_amd64`
* On Linux, it's `~/.terraform.d/plugins/linux_amd64`
* On Windows, it's `$APPDATA\terraform.d\plugins\windows_amd64`
### Build using the Makefile
Install [Go](https://www.golang.org/) v1.9+ on your machine; clone the source,
and let `make install` do the rest.
#### Mac
```sh
brew install go # or upgrade
brew install dep # or upgrade
mkdir -p $GOPATH/src/github.com/ewilde; cd $GOPATH/src/github.com/ewilde
git clone https://github.com/ewilde/terraform-provider-openfaas
cd terraform-provider-openfaas
make install
# it may take a while to download `hashicorp/terraform`. be patient.
```
#### Linux
Install go and dep from your favourite package manager or from source. Then:
```sh
mkdir -p $GOPATH/src/github.com/ewilde; cd $GOPATH/src/github.com/ewilde
git clone https://github.com/ewilde/terraform-provider-openfaas
cd terraform-provider-openfaas
make install
# it may take a while to download `hashicorp/terraform`. be patient.
```
#### Windows
In PowerShell, running as Administrator:
```powershell
choco install golang
choco install dep
choco install zip
choco install git # for git-bash
choco install make
```
In a shell that has Make, like Git-Bash:
```sh
mkdir -p $GOPATH/src/github.com/ewilde; cd $GOPATH/src/github.com/ewilde
git clone https://github.com/ewilde/terraform-provider-openfaas
cd terraform-provider-openfaas
make install
# it may take a while to download `hashicorp/terraform`. be patient.
```
## Developing the Provider
In order to test the provider, you can simply run `make test`.
```sh
$ make test
```
In order to run the full suite of Acceptance tests, run `make testacc`.
> Note: At the moment the acceptance tests assume OpenFaaS gateway is running on http://localhost:8080 *without*
basic authentication enabled.
```sh
$ make testacc
```
## Building the documentation
Currently a bit manual ¯\_(ツ)_/¯
1. build the content
```sh
$ make website-build
```
2. copy build output into `gh-pages` branch of this repo
```sh
$ git checkout gh-pages
cp -r ../terraform-website/content/build/docs/providers/openfaas/ ./docs/providers/openfaas
```