GithubHelp home page GithubHelp logo

lacework-aaronscheiber / terraform-provider-lacework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lacework/terraform-provider-lacework

0.0 0.0 0.0 14.91 MB

Terraform Lacework provider

License: Mozilla Public License 2.0

Shell 2.23% Go 95.32% Makefile 0.81% HTML 1.64%

terraform-provider-lacework's Introduction

Terraform Provider for Lacework

IaC
Codefresh build status

Requirements

  • Terraform 0.15.x
  • Go 1.18 (to build the provider plugin)

Building The Provider

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

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

Enter the provider directory, prepare and build the provider

cd $GOPATH/src/github.com/lacework/terraform-provider-lacework
make prepare
make build

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

Developing the Provider

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

To install the provider, run make install. This will build the provider, create the $HOME/.terraformrc and put the provider binary in the $HOME/.terraform.d/plugins directory.

make install

From here, you can cd into any folder that contains Terraform code and run terraform init, use one of the examples in the examples/ folder.

cd examples/data_source_lacework_api_token
terraform init
terraform apply

In order run the providers' unit tests, run the command make test:

make test

In order to run the full suite of integration tests, run make integration-test.

Note: Integration tests create real resources so you need to have a Lacework environment.

LW_ACCOUNT="<YOUR_ACCOUNT>" \
  LW_API_KEY="<YOUR_API_KEY>" \
  LW_API_SECRET="<YOUR_API_SECRET>" \
  make integration-test

Running Specific Integration Tests (RegEx)

When working on new tests or existing tests, you can use a regex to run only specific integration tests. For example, to run only the tests related to the resource lacework_policy use the regex TestPolicy:

make integration-test regex=TestPolicy

Uninstall Developer Environment

If you are doing development of the Lacework provider and you try to use the provider we release to the Terraform Registry, you won't be able to use it and you will see an error message similar to:

│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider lacework/lacework: no available releases match the given constraints

To fix this issue you need to uninstall the local provider (your developer environment) with the command:

make uninstall

terraform-provider-lacework's People

Contributors

afiune avatar dmurray-lacework avatar lacework-releng avatar dependabot[bot] avatar scottford-lw avatar mjunglw avatar vatasha avatar rmoles avatar robewedd avatar alannix-lw avatar andrewelizondo avatar varming avatar danifitz avatar jlosito avatar mbfrahry avatar hazedav avatar iacbot[bot] 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.