Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Fork of the terraform-provider-kong terraform plugin.

License

Notifications You must be signed in to change notification settings

rapid7/terraform-provider-kong

 
 

Repository files navigation

terraform-provider-kong (rapid7 fork)

NOTE: This repository was forked from https://github.com/WeKnowSports/terraform-provider-kong.

This fork's master branch updates main.go to point at this fork's kong package for use with go get/go install.

The master branch includes several patches contributed (or in review) from the rapid7 fork back to the upstream project.

Installation

Install a binary from releases into your terraform.d/plugins/${GOOS}_${GOARCH} directory.

NOTE: Optionally this can be installed under ~/.terraform.d/plugins in your home directory if you have multiple projects using the plugin.

GOOS=darwin
GOARCH=amd64
VERSION=0.1.0

wget -O terraform-provider-kong_v${VERSION} https://github.com/rapid7/terraform-provider-kong/releases/download/${VERSION}/${GOOS}_${GOARCH}-terraform-provider-kong_v${VERSION}
chmod +x terraform-provider-kong_v${VERSION}

# mv terraform-provider-kong_v${VERSION} ~/.terraform.d/plugins/${GOOS}_${GOARCH}/
mv terraform-provider-kong_v${VERSION} terraform.d/plugins/${GOOS}_${GOARCH}/

Usage

Once installed you can use the following to confirm you can use the plugin:

terraform init
terraform plan

Development

See the provider plugin codebase information at terraform.io.

  1. Ensure GOPATH, GOBIN, and PATH are set.
export GOPATH="${GOPATH:-$(echo -n ~/go)}"
export GOBIN="${GOPATH}/bin"
export PATH="${GOPATH}/bin:${PATH}"
  1. Clone this project into ${GOPATH}/src/github.com/rapid7/terraform-provider-kong.
  2. Install terraform into your GOPATH (required since terraform init will search for providers inside of GOPATH only):
go get github.com/hashicorp/terraform
go install github.com/hashicorp/terraform
  1. Make your intended changes.
  2. Use go install inside of ${GOPATH}/src/github.com/rapid7/terraform-provider-kong.
  3. Use terraform init in your terraform project.
  4. Confirm your changes work. Profit! 🎉

Distribution

  1. Figure out what the last released version was by looking at https://github.com/rapid7/terraform-provider-kong/releases.
  2. Create binaries for different platforms by bumping versions (use http://semver.org):
# Ensure gox is installed and in your PATH.
go get github.com/mitchellh/gox

VERSION="0.1.0"
gox -osarch="darwin/amd64 linux/amd64" -output="dist/{{.OS}}_{{.Arch}}/{{.Dir}}_v${VERSION}"  github.com/rapid7/terraform-provider-kong
  1. Create an annotated git tag for your version (e.g. v0.1.0).
  2. Push the tag and create a github release.
    • Attach your binaries.
    • Add the checksums into the release notes (using shasum -a 256).

Terraform provider for Kong

Uses Terraform to configure APIs in Kong. It fully supports creating APIs and consumers, but plugins and credentials are not complete (most plugins will work though).

go build -o tests/terraform-provider-kong

Compile and terraform plan / apply

Start kong

docker-compose up -d

Run plan

./start plan

Run apply

./start apply

Example usage

Please refer to terraform/tests

About

Fork of the terraform-provider-kong terraform plugin.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 94.8%
  • HCL 4.9%
  • Shell 0.3%