Clone repository to: $GOPATH/src/github.com/Seeweb/terraform-provider-seeweb
$ mkdir -p $GOPATH/src/github.com/Seeweb; cd $GOPATH/src/github.com/Seeweb
$ git clone git@github.com:Seeweb/terraform-provider-seeweb
Enter the provider directory and build the provider
$ cd $GOPATH/src/github.com/Seeweb/terraform-provider-seeweb
$ export GOPRIVATE=github.com/Seeweb/* # This step is only necessary if the modules are kept private
$ make build
In order to test a built version of this Terraform Provider locally, you will to run the following...
go build -o terraform-provider-seeweb
# The next location might be different in you machine so would need to check first
mv terraform-provider-seeweb ~/.terraform.d/plugins/registry.terraform.io/hashicorp/seeweb/0.0.1/darwin_arm64
After that you will be able to require the provider as seeweb
, like in the following example...
provider "seeweb" {} # Expecting Seeweb auth token in env var $SEEWEB_TOKEN
resource "seeweb_server" "testacc" {
plan = "ECS1"
location = "it-fr2"
image = "centos-7"
notes = "created with Terraform"
}
In order to test the provider, you can simply run make test
.
$ make test
In order to run the full suite of Acceptance tests, run make testacc
. Running the acceptance tests requires
that the SEEWEB_TOKEN
environment variable be set to a valid API Token.
Note: Acceptance tests create real resources, and often cost money to run.
$ make testacc
Run a specific subset of tests by name use the TESTARGS="-run TestName"
option which will run all test functions with "TestName" in their name.
$ make testacc TESTARGS="-run TestAccSeewebServer"