Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 2.1 KB

README.md

File metadata and controls

79 lines (54 loc) · 2.1 KB

Terraform Provider mssql

Requirements

  • Terraform 0.13.x
  • Go 1.15 (to build the provider plugin)

Usage

terraform {
  required_version = "~> 0.13"
  required_providers {
    mssql = {
      versions = "~> 0.0.1"
      source = "betr.io/betr/mssql"
    }
  }
}

provider "mssql" {}

Building the provider

Clone the repository

git clone [email protected]:betr-io/terraform-provider-mssql

Enter the provider directory and build the provider

cd terraform-provider-mssql
make build

To build and isntall the provider locally

make install

Developing the provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.15+).

To compile the provider, run make build. This will build the provider.

To run the unit test, you can simply run make test.

To run acceptance tests against a local SQL Server running in Docker, you must have Docker installed. You can then run the following commands

(cd test-fixtures/local && terraform apply)
make testacc-local
(cd test-fixtures/local && terraform destroy)

This will spin up a SQL server running in a container on your local machine, run the tests that can run against a SQL Server, and destroy the container.

In order to run the full suite of acceptance tests, run make testacc. Again, to spin up a local SQL Server container in docker, and corresponding resources in Azure, modify test-fixtures/all/terraform.tfvars to match your environment and run

(cd test-fixtures/all && terraform apply)
make testacc
(cd test-fixtures/all && terraform destroy)

NOTE: This will create resources in Azure and will incur costs.

Release provider

To create a release, do:

  • Update VERSION in Makefile (only used for installing the provider when developing).
  • Push a new valid version tag (e.g. v1.2.3) to GitHub.
  • See also Publishing Providers.