- Clone the repository
- Enter the repository directory
- Build the provider using the Go
buildcommand:
go buildThere is two ways to use the provider you just built from source:
- Define a developer override in your
~/.terraformrcpointing to this Terraform provider directory - Install the binary as a plugin by moving it to the right location in the example folder
Create a .terraformrc file in your home directory (~/.terraformrc) with the following content:
provider_installation {
dev_overrides {
"registry.terraform.io/CiscoDevNet/hyperfabric" = "<YOUR_GIT_CLONE_LOCATION>/terraform-provider-hyperfabric"
}
# 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 {}
}If you already have a ~/.terraformrc file, add the dev_overrides entry above in your existing list of dev_overrides.
You can now go into any Terraform directory and run terraform plan such as examples/resources/full_example in this directory. You do not need to run terraform init for the hyperfabric provider when using the dev_overrides.
Follow the instructions to install it as a plugin. After placing it into your plugins directory or the example folder (examples/resources/full_example) plugins directory, run terraform init to initialize it.
ex.
terraform {
required_providers {
hyperfabric = {
source = "CiscoDevNet/hyperfabric"
}
}
}
# Configure provider with your Cisco Nexus Hyperfabric token.
provider "hyperfabric" {
# Use the HYPERFABRIC_TOKEN environment variable to set your bearer token or use:
# token = "YOUR_HYPERFABRIC_BEARER_TOKEN"
}
resource "hyperfabric_fabric" "example" {
name = "example-fabric"
}The Cisco Nexus Hyperfabric provider is build using the terraform-plugin-framework provider SDK to benefit from Terraform latest capabilities and uses v6 of the Terraform protocol.
- Install latest version of Go
- New resources and data-sources are located in the internal/provider directory.
This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency to your Terraform provider:
go get github.com/author/dependency
go mod tidyThen commit the changes to go.mod and go.sum.
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To compile the provider, run go install. This will build the provider and put the provider binary in the $GOPATH/bin directory.
See the Changelog for full release notes.
For further information and guides, refer to the following:
This collection is licensed under the Mozilla Public License Version 2.0