tree: c9973d569159cb34a3133f8a5f1bf0ef6f08dacb [path history] [tgz]
  1. .gitignore
  2. main.go
  3. main.tf
  4. Makefile
  5. provider.go
  6. README.md
  7. resource_server.go
terraform-wskdeploy-plugin/README.md

(Experimental)Terraform Wskdeploy Plugin

A sample app to demo how to implement Terraform Plugin. The purpose is to try to integrate Terraform with wskdeploy so in the sample main.tf, we added a sample yaml path. Change the path to your local wskdeploy yaml file instead.

How to

This section describe how to build and run this demo app.

wskdeploy

wskdeploy is a tool to help deploy OpenWHisk packages in a batch, this guide assume you have a basic idea about OpenWhisk and how wskdeploy worked.

Install Go

For how to install go, please refer golang web site

Install terraform.

For how to install terraform, please refer terraform website

Clone wskdeploy repo

Clone wskdeploy repo under your $GOPATH

git clone https://github.com/apache/openwhisk-wskdeploy.git $GOPATH/src/github.com/apache/openwhisk-wskdeploy

The wskdeloy yaml file property is defined in sample main.tf, you can change $USER and $GOPATH in the file as your environments, so terraform could find your local wskdeploy yaml file.

Build and run

Run the below command to get all the dependencies: go get .

Then run: go build -o terraform-provider-example to generate a plugin which will be invoked by terraform.

You can get it directly as the terraform-provider-example bin in this repo.

Then run: terraform plan to see the config details.

Run command: terraform apply to deploy the manifest yaml file.

Next Steps:

We could add more config tags and implement the code logic to support such as update, delete etc, By defining new terraform style tags or we could use yaml instead.