{"id":21526337,"url":"https://github.com/netapp/terraform-provider-netapp-elementsw","last_synced_at":"2025-04-09T23:33:18.330Z","repository":{"id":43682806,"uuid":"245176048","full_name":"NetApp/terraform-provider-netapp-elementsw","owner":"NetApp","description":"Support for Volume, Initiator, Account, and Volume Access Group resources.","archived":false,"fork":false,"pushed_at":"2022-02-24T04:42:27.000Z","size":104,"stargazers_count":5,"open_issues_count":2,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-24T01:23:18.436Z","etag":null,"topics":["netapp-public","terraform","terraform-provider"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetApp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-05T13:52:54.000Z","updated_at":"2023-01-10T18:43:45.000Z","dependencies_parsed_at":"2022-09-05T18:11:28.945Z","dependency_job_id":null,"html_url":"https://github.com/NetApp/terraform-provider-netapp-elementsw","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fterraform-provider-netapp-elementsw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fterraform-provider-netapp-elementsw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fterraform-provider-netapp-elementsw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fterraform-provider-netapp-elementsw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetApp","download_url":"https://codeload.github.com/NetApp/terraform-provider-netapp-elementsw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248129954,"owners_count":21052669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["netapp-public","terraform","terraform-provider"],"created_at":"2024-11-24T01:44:38.775Z","updated_at":"2025-04-09T23:33:18.301Z","avatar_url":"https://github.com/NetApp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- TOC --\u003e\n\n- [Terraform NetApp ElementSW Provider](#terraform-netapp-elementsw-provider)\n    - [Naming Conventions](#naming-conventions)\n    - [Using the Provider](#using-the-provider)\n        - [Provider Documentation](#provider-documentation)\n        - [Controlling the provider version](#controlling-the-provider-version)\n    - [Building The Provider](#building-the-provider)\n        - [Prerequisites](#prerequisites)\n        - [Cloning the Project](#cloning-the-project)\n        - [Running the Build](#running-the-build)\n        - [Installing the Local Plugin](#installing-the-local-plugin)\n    - [Developing the Provider](#developing-the-provider)\n    - [Testing the Provider](#testing-the-provider)\n        - [Configuring Environment Variables](#configuring-environment-variables)\n            - [Using the .tf-elementsw-devrc.mk file](#using-the-tf-elementsw-devrcmk-file)\n        - [Running the Acceptance Tests](#running-the-acceptance-tests)\n        - [Walkthrough example](#walkthrough-example)\n            - [Installing Go and Terraform](#installing-go-and-terraform)\n            - [Installing dependencies](#installing-dependencies)\n            - [Cloning the NetApp provider repository and building the provider](#cloning-the-netapp-provider-repository-and-building-the-provider)\n            - [Sanity check](#sanity-check)\n\n\u003c!-- /TOC --\u003e\n\n# Terraform NetApp ElementSW Provider\n\nThis is the repository for the Terraform NetApp ElementSW Provider, which can be used with Terraform to configure resources on NetApp HCI or SolidFire storage clusters.\n\nFor general information about Terraform, visit the [official website][tf-website] and the [GitHub project page][tf-github].\n\n[tf-website]: https://terraform.io/\n[tf-github]: https://github.com/hashicorp/terraform\n\nThis provider plugin was initially developed by the SolidFire team for use with internal projects. The provider plugin was refactored to be published and maintained.\n\nThis provider was tested with ElementSW versions ranging from 11.1 up to 12.\n\n## Naming Conventions\n\nElementSW does not require resource names to be unique.  They are considered as 'labels' and resources in ElementSW are uniquely identified by 'ids'.  However these ids are not user friendly, and as they are generated on the fly, they make it difficult to track resources and automate.\n\nThis provider assumes that resource names are unique, and enforces it within its scope. This is not an issue if everything is managed through Terraform, but could raise conflicts if the rule is not respected outside of Terraform.\n\n## Using the Provider\n\nThe current version of this provider requires Terraform 0.12 or higher to run.\n\n- Newer Terraform releases such as 1.0.6 can download the provider from [Terraform Registry](https://registry.terraform.io/) so there's no need to build it from source. A complete how-to based on Terraform 1.0.6 and SolidFire 12.3 can be found [here](https://github.com/NetApp/terraform-provider-netapp-elementsw/tree/master/examples/elementsw).\n- Users of older Terraform releases such as Terraform 0.12 may need to build the provider from source before being able to use it, and load it locally (see [the section below](#building-the-provider)).\n\nNote that you need to run `terraform init` to fetch the provider before deploying.\n\n### Provider Documentation\n\nThe provider is documented [here](https://registry.terraform.io/providers/NetApp/netapp-elementsw/latest/docs).\n\nCheck the provider documentation for details on entering your connection information and how to get started with writing configuration for NetApp ElementSW resources.\n\n### Controlling the provider version\n\nNote that you can also control the provider version. Since Terraform 0.13 this requires the use of a `required_providers` block in your Terraform configuration.\n\nThe syntax that loads the provider from Terraform Registry is as follows:\n\n```hcl\nrequired_providers {\n  netapp-elementsw = {\n    version = \"~\u003e 20.11\"\n    source  = \"NetApp/netapp-elementsw\"\n  }\n}\n```\n\nVersion locking uses a pessimistic operator, so this version lock would mean anything within the 20.11 namespace, including or after 20.11.0. Read more [here][provider-vc] on provider version control.\n\nFor offline loading please see the walk-through for building from source.\n\n[provider-vc]: https://www.terraform.io/docs/language/providers/requirements.html#version\n\n## Building The Provider\n\nThis section is intended for developers. Regular users can start with this ready-to-use [example](https://github.com/NetApp/terraform-provider-netapp-elementsw/tree/master/examples/elementsw).\n\n### Prerequisites\n\nIf you wish to work on the provider, you'll first need [Go][go-website] installed on your machine (version 1.14+ is **required** to build with current dependencies). You'll also need to correctly setup a [GOPATH][gopath], as well as adding `$GOPATH/bin` to your `$PATH`.\n\n[go-website]: https://golang.org/\n[gopath]: http://golang.org/doc/code.html#GOPATH\n\nThe following go packages are required to build the provider:\n\n```sh\ngo get github.com/fatih/structs\ngo get github.com/hashicorp/terraform\ngo get github.com/sirupsen/logrus\ngo get github.com/x-cray/logrus-prefixed-formatter\n```\n\n### Cloning the Project\n\nFirst, you will want to clone the repository to\n`$GOPATH/src/github.com/netapp/terraform-provider-netapp-elementsw`:\n\n```sh\nmkdir -p $GOPATH/src/github.com/netapp\ncd $GOPATH/src/github.com/netapp\ngit clone https://github.com/NetApp/terraform-provider-netapp-elementsw.git\n```\n\n### Running the Build\n\nAfter the clone has been completed, you can enter the provider directory and\nbuild the provider.\n\n```sh\ncd $GOPATH/src/github.com/netapp/terraform-provider-netapp-elementsw\nmake build\n```\n\n### Installing the Local Plugin\n\nAfter the build is complete, copy the `terraform-provider-netapp-elementsw` binary into the same path as your `terraform` binary, and re-run `terraform init`.\n\nAfter this, your project-local `.terraform/plugins/ARCH/lock.json` (where `ARCH` matches the architecture of your machine) file should contain a SHA256 sum that matches the local plugin. Run `shasum -a 256` on the binary to verify the values match.\n\n## Developing the Provider\n\n**NOTE:** Before you start work on a feature, please make sure to check the [issue tracker][gh-issues] and existing [pull requests][gh-prs] to ensure that work is not being duplicated. For further clarification, you can also ask in a new issue.\n\n[gh-issues]: https://github.com/netapp/terraform-provider-netapp-elementsw/issues\n[gh-prs]: https://github.com/netapp/terraform-provider-netapp-elementsw/pulls\n\nSee [Building the Provider](#building-the-provider) for details on building the provider.\n\n## Testing the Provider\n\n**NOTE:** Testing the NetApp ElementSW provider is currently a complex operation as it requires having an ElementSW endpoint to test against, which should be hosting a standard configuration for a HCI or SolidFire cluster. If you have a NetApp Support account, you may instead download Element Demo VM 12 from the Tools section, and deploy a singleton VM-based SolidFire cluster on VMware.\n\n### Configuring Environment Variables\n\nMost of the tests in this provider require a comprehensive list of environment variables to run. See the individual `*_test.go` files in the [`elementsw/`](elementsw/) directory for more details. The next section also describes how you can manage a configuration file of the test environment variables.\n\n#### Using the `.tf-elementsw-devrc.mk` file\n\nThe [`tf-elementsw-devrc.mk.example`](tf-elementsw-devrc.mk.example) file contains an up-to-date list of environment variables required to run the acceptance tests. Copy this to `$HOME/.tf-elementsw-devrc.mk` and change the permissions to something more secure (ie: `chmod 600 $HOME/.tf-elementsw-devrc.mk`), and configure the variables accordingly.\n\n### Running the Acceptance Tests\n\nAfter this is done, you can run the acceptance tests by running:\n\n```sh\nmake testacc\n```\n\nIf you want to run against a specific set of tests, run `make testacc` with the `TESTARGS` parameter containing the run mask as per below:\n\n```sh\nmake testacc TESTARGS=\"-run=TestAccElementSwVolume\"\n```\n\nThis following example would run all of the acceptance tests matching `TestAccElementSwVolume`. Change this for the specific tests you want to run.\n\n### Walkthrough example\n\nIf you are not building from source or want to download provider from online Terraform Registry, please refer to README in the subdirectory examples/elementsw.\n\n#### Installing Go and Terraform\n\n```sh\nbash\nmkdir tf_na_elementsw\ncd tf_na_elementsw\n\n# if you want a private installation, use\nexport GO_INSTALL_DIR=`pwd`/go_install\nmkdir $GO_INSTALL_DIR\n# otherwise, go recommends to use\nexport GO_INSTALL_DIR=/usr/local\n\n\ncurl -O https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz\ntar -C $GO_INSTALL_DIR -xvf go1.14.1.linux-amd64.tar.gz\n\nexport PATH=$PATH:$GO_INSTALL_DIR/go/bin\n\ncurl -O https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip\nunzip terraform_0.12.24_linux_amd64.zip\nmv terraform $GO_INSTALL_DIR/go/bin\n```\n\n#### Installing dependencies\n\n```sh\n# make sure git is installed\nwhich git\n\nexport GOPATH=`pwd`\ngo get github.com/fatih/structs\ngo get github.com/hashicorp/terraform\ngo get github.com/sirupsen/logrus\ngo get github.com/x-cray/logrus-prefixed-formatter\n```\n\nNote getting the terraform package also builds and installs terraform in $GOPATH/bin.\nThe version in go/bin is a stable release.\n\n#### Cloning the NetApp provider repository and building the provider\n\n```sh\nmkdir -p $GOPATH/src/github.com/netapp\ncd $GOPATH/src/github.com/netapp\ngit clone https://github.com/NetApp/terraform-provider-netapp-elementsw.git\ncd terraform-provider-netapp-elementsw\nmake build\nmv $GOPATH/bin/terraform-provider-netapp-elementsw $GO_INSTALL_DIR/go/bin\n```\n\nThe build step will install the provider in the $GOPATH/bin directory. For Terraform 0.11 and 0.12 you could use it from there, for version 0.13 and later, copy it to `/usr/share/terraform/providers/netapp.com/` and load it with:\n\n```hcl\nrequired_providers {\n  netapp-elementsw = {\n    version = \"0.1.0\"\n    source = \"netapp.com/elementsw/netapp-elementsw\"\n  }\n}\n```\n\n#### Sanity check\n\n```sh\ncd examples/elementsw/\nterraform init\n```\n\nShould do nothing but indicate that `Terraform has been successfully initialized!`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetapp%2Fterraform-provider-netapp-elementsw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetapp%2Fterraform-provider-netapp-elementsw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetapp%2Fterraform-provider-netapp-elementsw/lists"}