Skip to content

camptocamp/terraform-provider-geoserver

Repository files navigation

Geoserver Terraform Provider

Terraform Registry Version Go Report Card By Camptocamp

This provider adds integration between Terraform and Geoserver.

Requirements

Building The Provider

Download the provider source code

$ go get github.com/camptocamp/terraform-provider-geoserver

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/camptocamp/terraform-provider-geoserver
$ make build

Installing the provider

After building the provider, install it using the Terraform instructions for installing a third party provider.

Example

provider geoserver {
  url = "https://geoserver.example.tld"   # or set $GEOSERVER_URL
  username = "admin"                      # or set $GEOSERVER_USERNAME
  password = "password"                   # or set $GEOSERVER_PASSWORD
  insecure = true
}

resource "geoserver_workspace" "foo" {
  name = "foo"
}

resource "geoserver_datastore" "default" {
  workspace_name = geoserver_workspace.foo.name
  name           = "default"
  type           = "postgis"
  host           = "pgmaster"
  port           = "5432"
  db_name        = "test"
  db_user        = "postgres"
  db_pass        = "postgres"
}