Skip to content

dikhan/terraform-provider-logentries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logentries Terraform Provider

Requirements

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

Building The Provider

Clone repository to: $GOPATH/src/github.com/dikhan/terraform-provider-logentries

$ go get github.com/dikhan/terraform-provider-logentries

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/dikhan/terraform-provider-logentries
$ go build

Using the provider

Refer to the READMEs inside the examples folder to see how to configure each resource provided by this terraform provider.

Developing the Provider

To compile the provider, run go build. This will build the provider and put the provider binary in the current $GOPATH/src/github.com/dikhan/terraform-provider-logentries directory.

$ go build
...
$ ls -la terraform-provider-logentries
...

In order to test the provider, you can simply run:

$ TF_ACC=1 LOGENTRIES_API_KEY="API_KEY" go test $(go list ./...) -timeout 120m -v

Expected output:

$ TF_ACC=1 LOGENTRIES_API_KEY="<API_KEY>" go test $(go list ./...) -timeout 120m -v
?       github.com/dikhan/terraform-provider-logentries [no test files]
=== RUN   TestLogentriesProvider
--- PASS: TestLogentriesProvider (0.00s)
=== RUN   TestAccLogentriesLog_Create
--- PASS: TestAccLogentriesLog_Create (8.81s)
=== RUN   TestAccLogentriesLog_Update
--- PASS: TestAccLogentriesLog_Update (11.08s)
=== RUN   TestAccLogentriesLogSets_Create
--- PASS: TestAccLogentriesLogSets_Create (0.98s)
=== RUN   TestAccLogentriesLogSets_Update
--- PASS: TestAccLogentriesLogSets_Update (1.60s)
=== RUN   TestAccLogentriesTags_Create
--- PASS: TestAccLogentriesTags_Create (13.36s)
=== RUN   TestAccLogentriesTags_Update
--- PASS: TestAccLogentriesTags_Update (19.71s)
PASS
ok      github.com/dikhan/terraform-provider-logentries/logentries      55.636s

Or specific tests can also be executed as follows:

$ TF_ACC=1 LOGENTRIES_API_KEY="<API_KEY>" go test github.com/dikhan/terraform-provider-logentries/logentries -run  ^TestAccLogentriesTags_Create$ -timeout 120m -v

The acceptance tests require a LOGENTRIES_API_KEY to be set. This env variable value will be used within the tests to successfully interact with the log entries api.

Note: Acceptance tests create real resources and perform clean up tasks afterwards.

Contributing

Please follow the guidelines from:

Authors

Daniel I. Khan Ramiro

See also the list of contributors who participated in this project.

About

Logentries Terraform Provider

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages