/terraform-provider-nirmata

Nirmata Terraform Provider

Primary LanguageGoApache License 2.0Apache-2.0

Terraform Provider for Nirmata

See documentation and examples at the Terraform Registry.

Releasing

To release a new version create a tag (using semantic versioning) and push upstream. The release process is completed via a GitHub Action

git tag -a v1.x.x -m "...."
git push --tags

Building

make

Testing locally

  1. Configure dev_overrides in your .terraform.rc or terraform.rc file. See: https://www.terraform.io/docs/cli/config/config-file.html#development-overrides-for-provider-developers.
provider_installation {
    dev_overrides {
        "registry.terraform.io/nirmata/nirmata" = "<repo path>/dist/<platform>_<architecture>"
    }

    # For all other providers, install them directly from their origin provider
    # registries as normal. If you omit this, Terraform will _only_ use
    # the dev_overrides block, and so no other providers will be available.
    direct {}
}

For example on Windows the nirmata/nirmata provider would be set to "C:\\go\\src\\github.com\\nirmata\\terraform-provider-nirmata\\dist\\windows_amd64"

  1. Build the plugin using make.

  2. Set your NIRMATA_TOKEN environment variable to contain your Nirmata API key. You can optionally set NIRMATA_URL to point to the Nirmata address (defaults to https://nirmata.io.)

  3. Navigate to the examples and initialize the Terraform provider:

terraform init 

If you see the error below, delete the .terraform.lock.hcl file and re-run the init command:

Error while installing local/nirmata/nirmata v99.0.0: the local package for
local/nirmata/nirmata 99.0.0 doesn't match any of the checksums previously
recorded in the dependency lock file (this might be because the available
checksums are for packages targeting different platforms)
  1. Run plan to build the execution plan:
terraform plan
  1. Run apply to execute the plan:
terraform apply
  1. Run show to see the created resources:
terraform show
  1. Run destroy to delete the created resources:
terraform destroy samples/cloud_provider/gke

Troubleshooting

Set the TF_LOG environment variable to DEBUG or TRACE.

export TF_LOG=DEBUG