Giter Site home page Giter Site logo

terraform-provider-ldap's Introduction

LDAP Terraform Provider Build Status

Overview

This Terraform provider plugin interact with LDAP declaratively using HCL.

Requirements

  • Terraform 0.10.x
  • Go 1.8 (to build the provider plugin)

Building The Provider

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-ldap

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone [email protected]:terraform-providers/terraform-provider-ldap

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-ldap
$ make build

Using the provider

Download the release binary and copy it to the $HOME/terraform.d/plugins/<os>_<arch>/ folder. For example /home/youruser/terraform.d/plugins/linux_amd64 for a Linux environment or /Users/youruser/terraform.d/plugins/darwin_amd64 for a MacOS environment.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.8+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

Clone this repository to GOPATH/src/github.com/terraform-providers/terraform-provider-ldap as its packaging structure has been defined such that it will be compatible with the Terraform provider plugin framwork in 0.10.x.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-ldap
...

Testing the Provider

In order to run the tests an LDAP server needs to be run locally using the test directory database. You can launch this server in Docker using the provided script "scripts/ldap-up.sh". Once the LDAP server is running it can be accessed via the phpLDAPadmin application launched alongside the LDAP server via this link. Once the instance is running you will need to export the following environment variables.

export LDAP_HOST=<local host IP>
export LDAP_BIND_DN=cn=admin,dc=example,dc=org
export LDAP_BIND_PASSWORD=admin

Export the following environment variable to enable debug log for the provider.

export LDAP_DEBUG=true

To launch the LDAP server in docker:

cd <repository root>
scripts/ldap-up.sh

To run the provider unit tests:

cd <repository root>/ldap
TF_ACC=1 go test -v -timeout 120m .

Acceptance tests are run against a LDAP instance in AWS before a release is created. Any other testing should be done using the local LDAP instance.

$ make testacc

Terraform Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.