Coder Social home page Coder Social logo

saamuelantunes / terraform-provider-datadog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datadog/terraform-provider-datadog

0.0 0.0 0.0 9.58 MB

Terraform Datadog provider

Home Page: https://www.terraform.io/docs/providers/datadog/

License: Mozilla Public License 2.0

Makefile 0.29% Go 98.79% Shell 0.28% HTML 0.64%

terraform-provider-datadog's Introduction

Terraform Provider

Requirements

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

Building The Provider

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

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

Enter the provider directory and build the provider

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

Note: For contributions created from forks, the repository should still be cloned under the $GOPATH/src/github.com/terraform-providers/terraform-provider-datadog directory to allow the provided make commands to properly run, build, and test this project.

Using the provider

If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init to initialize it.

Further usage documentation is available on the Terraform website.

Developing the Provider

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

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-datadog
...

In order to test the provider, you can simply run make test.

$ make test

Note that the above command runs acceptance tests by replaying pre-recorded API responses (cassettes) stored in datadog/cassettes/. When tests are modified, the cassettes need to be re-recorded.

In order to make tests cassette friendly, it's necessary to ensure that resources always get manipulated in a predictable order. When creating a testing Terraform config that defines multiple resources at the same time, you need to set inter-resource dependencies (using depends_on) in such a way that there is only one way for Terraform to manipulate them. For example, given resources A, B and C in the same config string, you can achieve this by making A depend on B and B depend on C. See PR #442 for an example of this.

Note: Recording cassettes creates/updates/destroys real resources. Never run this on a production Datadog organization.

In order to re-record all cassettes you need to have DATADOG_API_KEY and DATADOG_APP_KEY for your testing organization in your environment. With that, run make cassettes. Do note that this would regenerate all cassettes and thus take a very long time; if you only need to re-record cassettes for one or two tests, you can run make cassettes TESTARGS ="-run XXX" - this will effectively execute go test -run=XXX, which would run all testcases that contain XXX in their name.

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create/update/destroy real resources. Never run this on a production Datadog organization.

$ make testacc

terraform-provider-datadog's People

Contributors

bkabrda avatar masci avatar nmuesch avatar grubernaut avatar tanguylebarzic avatar radeksimko avatar ojongerius avatar anatolebeuzon avatar platinummonkey avatar gzussa avatar tombuildsstuff avatar stack72 avatar tt810 avatar hryamzik avatar jirikuncar avatar gabsn avatar enbashi avatar btoueg avatar bflad avatar appilon avatar visciang avatar dragon3 avatar catsby avatar nyanshak avatar cvbarros avatar travisjeffery avatar opteemister avatar mrmarvin avatar apparentlymart avatar jbenais avatar

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.