Skip to content

Latest commit

 

History

History
115 lines (84 loc) · 2.91 KB

File metadata and controls

115 lines (84 loc) · 2.91 KB
subcategory page_title description
Authenticate to Morpheus
A guide to obtaining client credentials and adding them to provider configuration.

Authentication

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

Static Credentials

!> Warning: Hard-coded credentials are not recommended in any Terraform configuration and risks secret leakage should this file ever be committed to a public version control system.

Username and Password

Static credentials using a username and password can be provided by adding a username and password in-line in the Morpheus provider block:

provider "morpheus" {
  url      = "https://morpheus_appliance_url"
  username = "admin"
  password = "password"
}

Subtenant Username and Password

Static credentials for authenticating to a subtenant using a username and password can be provided by adding a username and password along with tenant_subdomain in-line in the Morpheus provider block:

provider "morpheus" {
  url              = "https://morpheus_appliance_url"
  tenant_subdomain = "subtenant1"
  username         = "admin"
  password         = "password"
}

Access Token

Static credentials using an access token can be provided by adding an access_token in-line in the Morpheus provider block:

Usage:

provider "morpheus" {
  url          = "https://morpheus_appliance_url"
  access_token = "d3a4c6fa-fb54-44af"
}

Environment Variables

Username and Password

Environment variable using a username and password can be provided by using the MORPHEUS_API_URL, MORPHEUS_API_USERNAME and MORPHEUS_API_PASSWORD environment variables:

provider "morpheus" {}

Usage:

$ export MORPHEUS_API_URL="https://morpheus_appliance_url"
$ export MORPHEUS_API_USERNAME="admin"
$ export MORPHEUS_API_PASSWORD="password"
$ terraform plan

Subtenant Username and Password

Environment variable using a username and password can be provided by using the MORPHEUS_API_URL, MORPHEUS_API_TENANT, MORPHEUS_API_USERNAME and MORPHEUS_API_PASSWORD environment variables:

provider "morpheus" {}

Usage:

$ export MORPHEUS_API_URL="https://morpheus_appliance_url"
$ export MORPHEUS_API_TENANT="subtenant1"
$ export MORPHEUS_API_USERNAME="admin"
$ export MORPHEUS_API_PASSWORD="password"
$ terraform plan

Access Token

Environment variable using an access token can be provided by using the MORPHEUS_API_URL and MORPHEUS_API_TOKEN environment variables:

provider "morpheus" {}

Usage:

$ export MORPHEUS_API_URL="https://morpheus_appliance_url"
$ export MORPHEUS_API_TOKEN="d3a4c6fa-fb54-44af"
$ terraform plan