/terraform-provider-mcs

Terraform MCS Provider

Primary LanguageGoMozilla Public License 2.0MPL-2.0

Terraform MCS Provider

Requirements

  • Terraform 1.0.x
  • Go 1.18 (to build the provider plugin)

Using The Provider

To use the provider, prepare configuration files based on examples from here

$ cd $GOPATH/src/github.com/MailRuCloudSolutions/terraform-provider-mcs/examples/create-mcs-cluster
$ vim provider.tf
$ terraform init
$ terraform plan

Provider development

To start improve it grab the repository, build it and install into local registry repository. Builds for MacOS, Windows and Linux are available. The example is for MacOS.

$ mkdir -p $GOPATH/src/github.com/MailRuCloudSolutions
$ cd $GOPATH/src/github.com/MailRuCloudSolutions
$ git clone git@github.com:MailRuCloudSolutions/terraform-provider-mcs.git
$ cd $GOPATH/src/github.com/MailRuCloudSolutions/terraform-provider-mcs
$ make build_darwin
$ mkdir -p ~/.terraform.d/plugins/hub.mcs.mail.ru/repository/mcs/0.5.8/darwin_amd64/
$ cp terraform-provider-mcs_darwin ~/.terraform.d/plugins/hub.mcs.mail.ru/repository/mcs/0.5.8/darwin_amd64/terraform-provider-mcs_v0.5.8

$ cat <<EOF > main.tf 
terraform {
  required_providers {
    mcs = {
      source  = "hub.mcs.mail.ru/repository/mcs"
      version = "~> 0.5.8"
    }
  }
}
EOF
$ terraform init

Publishing provider

Provider publishes via action release. To call the action create new tag.

$ git tag v0.5.8
$ git push origin v0.5.8

Thank You!