Skip to content

Authentication

Sandeep Sidhu edited this page Apr 20, 2017 · 4 revisions

Authentication

The NSX provider offers flexible means of providing credentials for authentication. The following methods are supported, in this order and explained below:

  • Static credentials
  • Environment variables
Static credentials

Static credentials can be provided by adding nsxusername, nsxpassword and nsxserver in-line in the nsx provider block:

Usage:

provider "nsx" {
    nsxusername = "username"
    nsxpassword = "password"
    nsxserver = "apnsx020"
}
Environment variables

You can provide your credentials via NSXUSERNAME, NSXPASSWORD and NSXSERVER environment variables, representing your user name, password and NSX server respectively.

provider "nsx" {}

Usage:

$ export NSXUSERNAME='username'
$ export NSXPASSWORD='password'
$ export NSXSERVER='apnsx020'
$ terraform plan

Argument Reference

The following arguments are supported in the provider block:

  • debug - (Optional) Show debug output of API operations to NSX If omitted, default value is false.
  • insecure - (Optional) Explicitly allow the provider to perform "insecure" SSL requests. If omitted, default value is false.
  • nsxpassword - (Optional) This is the password for connecting to the NSX server. It must be provided, but it can also be sourced from the NSXPASSWORD environment variable.
  • nsxusername - (Optional) This is the user name for connecting to the NSX server. It must be provided, but it can also be sourced from the NSXUSERNAME environment variable.
  • nsxserver - (Optional) This is the NSX server to connect to. It must be provided, but it can also be sourced from the NSXSERVER environment variable.