Clone this repository to: $GOPATH/src/github.com/Constellix/terraform-provider-constellix
.
$ mkdir -p $GOPATH/src/github.com/Constellix; cd $GOPATH/src/github.com/Constellix
$ git clone https://github.com/Constellix/terraform-provider-constellix.git
Enter the provider directory and run make build to build the provider binary.
$ cd $GOPATH/src/github.com/Constellix/terraform-provider-constellix
$ make build
If you are 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.
ex.
#configure provider with your Constellix credentials.
provider "constellix" {
# constellix Api key
apikey = "apikey"
# cosntellix secret key
secretkey = "secretkey"
insecure = true
proxy_url = "https://proxy_server:proxy_port"
}
resource "constellix_domain" "domain1" {
name = "domain1.com"
soa = {
primary_nameserver = "ns41.constellix.com."
ttl = 1800
refresh = 48100
retry = 7200
expire = 1209
negcache = 8000
}
}
Note : If you are facing the issue of 409 conflict error
try running your Terraform configuration with parallelism set to one as mentioned below.
terraform plan -parallelism=1
terraform apply -parallelism=1
If you want to work on the provider, you'll first need Go installed on your machine. 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 with sanity checks present in scripts directory and put the provider binary in $GOPATH/bin
directory.
The release candidates and new stable versions of this provider can be deployed using the following process:
-
Calculate new version by incrementing the previous version. If current version is
v0.4.5
, next release candidates should be named asv0.4.6-rc.1, v0.4.6-rc.2, ...
and stable version should bev0.4.6
. -
Create the tag and push it
git tag v0.4.6
git push origin v0.4.6
- On creation of the new tag (starting with letter
v
), the release workflow will execute as a GitHub Action and would create adraft
release. - Review the
draft
release listed on releases page. - Add release notes (recommended) and publish the release.
- Once release is published, it will automatically push changes to terraform registry, which will publish the new version on https://registry.terraform.io/providers/Constellix/constellix.