No description
  • Go 98.7%
  • HTML 0.6%
  • Makefile 0.4%
  • Shell 0.3%
Find a file
Paco Preciado Mendoza 4e0a469027
Merge pull request #160 from terraform-providers/removeDocs
Removed volume_group documentations
2020-08-10 08:00:42 -05:00
.github/ISSUE_TEMPLATE Update issue templates 2020-04-15 08:51:16 -07:00
client Merge pull request #138 from terraform-providers/fix-#78 2020-06-19 13:32:33 -05:00
examples chore: update example configuration to support terraform 0.12 syntax 2019-08-28 12:41:34 -05:00
future chore: removed project documentation 2020-07-02 17:42:48 -05:00
nutanix chore: removed project documentation 2020-07-02 17:42:48 -05:00
scripts chore: update terraform 0.12 dependencies 2019-08-28 12:41:34 -05:00
utils Fix for issue 58 -> error when using guest_customization_cloud_init_custom_key_values 2020-03-20 19:48:51 +01:00
vendor chore: updated vendor dependencies 2020-06-26 11:08:06 -05:00
website chore: removing volume groups from the documentation 2020-08-06 09:23:25 -05:00
.gitignore chore: added * into gitignore 2020-04-24 11:50:49 -05:00
.golangci.yml cleanup ClusterIntentResource 2020-05-27 12:47:57 -05:00
.goreleaser.yml update goreleaser to support ppc64le for IBM CAM 2018-07-05 14:43:56 -04:00
.travis.yml chore: updated vendor and dependecies 2020-04-23 17:03:40 -05:00
CHANGELOG.md Merge pull request #154 from terraform-providers/updated_doc 2020-07-07 10:53:26 -05:00
CONTRIBUTING.md Create CONTRIBUTING.md 2018-05-02 15:52:37 -04:00
GNUmakefile chore: updated vendor and dependecies 2020-04-23 17:03:40 -05:00
go.mod chore: updated terraform dependency 2020-06-26 11:08:05 -05:00
go.sum chore: updated terraform dependency 2020-06-26 11:08:05 -05:00
LICENSE Change LICENSE to MPL2 per hashi 2018-06-12 12:09:41 -04:00
main.go refactoring code and reorganizing project structre 2018-04-12 15:27:54 -05:00
README.md chore: updated README by requiremts changes 2020-07-06 11:29:51 -05:00
tools.go chore: make formatt 2020-04-23 17:49:05 -05:00

Terraform Nutanix Provider

Terraform provider plugin to integrate with Nutanix Enterprise Cloud

NOTE: The latest version of the Nutanix provider is v1.1.0

Build, Quality Status

Go Report Card

Master Develop
Build Status Build Status

Community

Nutanix is taking an inclusive approach to developing this new feature and welcomes customer feedback. Please see our development project on GitHub (you're here!), comment on requirements, design, code, and/or feel free to join us on Slack. Instructions on commenting, contributing, and joining our community Slack channel are all located within our GitHub Readme.

For a slack invite, please contact terraform@nutanix.com from your business email address, and we'll add you.

Provider Development

  • Terraform 0.12+
  • Go 1.12+ (to build the provider plugin)

Provider Use

The Terraform Nutanix provider is designed to work with Nutanix Prism Central, such that you can manage one or more Prism Element clusters at scale. AOS/PC 5.6.0 or higher is required, as this Provider makes exclusive use of the v3 APIs

Example Usage

See the Examples folder for a handful of main.tf demos as well as some pre-compiled binaries.

We'll be refreshing these examples and binaries as we work through tech preview.

Long term, once this is upstream, no pre-compiled binaries will be needed, as terraform will automatically download on use.

Configuration Reference

The following keys can be used to configure the provider.

  • endpoint - (Required) IP address for the Nutanix Prism Central.
  • username - (Required) Username for Nutanix Prism Central. Could be local cluster auth (e.g. auth) or directory auth.
  • password - (Required) Password for the provided username.
  • port - (Optional) Port for the Nutanix Prism Central. Default port is 9440.
  • insecure - (Optional) Explicitly allow the provider to perform insecure SSL requests. If omitted, default value is false.
  • wait_timeout - (optional) Set if you know that the creation o update of a resource may take long time (minutes).
provider "nutanix" {
  username     = "admin"
  password     = "myPassword"
  port         = 9440
  endpoint     = "10.36.7.201"
  insecure     = true
  wait_timeout = 10
}

Resources

  • nutanix_virtual_machine
  • nutanix_subnet
  • nutanix_network_security_rule
  • nutanix_image
  • nutanix_category_value
  • nutanix_category_key

Data Sources

  • nutanix_virtual_machine
  • nutanix_subnet
  • nutanix_subnets
  • nutanix_network_security_rule
  • nutanix_image
  • nutanix_host
  • nutanix_hosts
  • nutanix_cluster
  • nutanix_clusters
  • nutanix_category_key

Quick Install

Install Dependencies

For developing or build from source

  • Go 1.12+ (to build the provider plugin)

Building/Developing Provider

We recomment to use Go 1.12+ to be able to use go modules

$ git clone https://github.com/terraform-providers/terraform-provider-nutanix.git

Enter the provider directory and build the provider

$ make tools
$ make build

This will create a binary file terraform-provider-nutanix you can copy to your terraform specific project.

Alternative build: with our demo

$ make tools
$ go build -o examples/terraform-provider-nutanix
$ cd examples
$ terraform init #to try out our demo

If you need multi-OS binaries such as Linux, macOS, Windows. Run the following command.

$ make tools
$ make cibuild

This coommand will create a pkg/ directory with all the binaries for the most popular OS.

Common Issues using the development binary.

Terraform download the released binary instead developent one.

Just follow this steps to get the development binary:

  1. Copy the development terraform binary in the root folder of the project (i.e. where your main.tf is), this should be named terraform-provider-nutanix

  2. Remove the entire “.terraform” directory.

    rm -rf .terraform/
    
  3. Run the following command in the same folder where you have copied the development terraform binary.

    terraform init -upgrade
    terraform providers -version
    
  4. You should see version as “nutanix (unversioned)”

  5. Then run your main.tf

Release it

  1. Install goreleaser tool:

    go get -v github.com/goreleaser/goreleaser
    cd $GOPATH/src/github.com/goreleaser/goreleaser
    go install
    

    Alternatively you can download a latest release from goreleaser Releases Page

  2. Clean up folder (builds) if exists

  3. Make sure that the repository state is clean:

    git status
    
  4. Tag the release:

    git tag v1.1.0
    
  5. Run goreleaser:

    cd (TODO: go dir)
    goreleaser --skip-publish v1.1.0
    
  6. Check builds inside (TODO: build dir) directory.

  7. Publish release tag to GitHub:

    git push origin v1.1.0
    

Additional Resources

We've got a handful of resources outside of this repository that will help users understand the interactions between terraform and Nutanix

  • YouTube _ Overview Video: _ Working with images:
  • Nutanix GitHub _ _ Private repo until code goes upstream
  • Jons GitHub _ _ Contains sample TFs and PDFs from the youtube videos
  • Slack channel * User community slack channel is available on nutanix.slack.com. Email terraform@nutanix.com to gain entry.