File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,27 @@ WEBSITE_REPO=github.com/hashicorp/terraform-website
55VERSION =$(shell [ ! -z `git tag -l --contains HEAD` ] && git tag -l --contains HEAD || git rev-parse --short HEAD)
66GOPATH =$(shell go env GOPATH)
77
8+ TERRAFORM_PLUGIN_ROOT_DIR =$(HOME ) /.terraform.d/plugins
9+ TERRAFORM_PROVIDER_REFERENCE_NAME =local
10+ TERRAFORM_PROVIDER_NAME =sysdiglabs/$(PKG_NAME )
11+ TERRAFORM_PROVIDER_DEV_VERSION =1.0.0
12+ TERRAFORM_PLATFORM =$(shell terraform version -json | jq -r .platform)
13+ TERRAFORM_SYSDIG_PLUGIN_DIR =$(TERRAFORM_PLUGIN_ROOT_DIR ) /$(TERRAFORM_PROVIDER_REFERENCE_NAME ) /$(TERRAFORM_PROVIDER_NAME ) /$(TERRAFORM_PROVIDER_DEV_VERSION ) /$(TERRAFORM_PLATFORM )
14+
815default : build
916
1017build : fmtcheck
1118 go install
1219
20+ install : fmtcheck
21+ go build -o terraform-provider-sysdig
22+ mkdir -p $(TERRAFORM_SYSDIG_PLUGIN_DIR )
23+ cp terraform-provider-sysdig $(TERRAFORM_SYSDIG_PLUGIN_DIR ) /terraform-provider-sysdig
24+
25+ uninstall :
26+ rm -rf $(TERRAFORM_SYSDIG_PLUGIN_DIR )
27+
28+
1329sweep :
1430 @echo " WARNING: This will destroy infrastructure. Use only in development accounts."
1531 go test $(TEST ) -v -sweep=$(SWEEP ) $(SWEEPARGS )
Original file line number Diff line number Diff line change @@ -55,10 +55,41 @@ $ make test
5555```
5656
5757If you want to execute the acceptance tests, you can run ` make testacc ` .
58+
5859``` sh
5960$ make testacc
6061```
6162
63+ To use the local provider you just built, get it installed in your machine with:
64+
65+ ``` sh
66+ $ make install
67+ ```
68+
69+ That will add the provider to the terraform plugins dir. Then just set ` source ` and ` version ` values appropiately:
70+
71+ ```
72+ provider "aws" {
73+ region = my_region
74+ }
75+
76+ terraform {
77+ required_providers {
78+ sysdig = {
79+ source = "local/sysdiglabs/sysdig"
80+ version = "~> 1.0.0"
81+ }
82+ }
83+ }
84+ ```
85+
86+ To uninstall the plugin:
87+
88+ ```
89+ $ make uninstall
90+ ```
91+
92+
6293<br />:warning : Please note that you need a token for Monitor and Secure, and since the ** acceptance tests create real infrastructure**
6394you should execute them in an environment where you can remove the resorces easily.
6495
You can’t perform that action at this time.
0 commit comments