subcategory | page_title | description |
---|---|---|
Authenticate to Morpheus |
A guide to obtaining client credentials and adding them to provider configuration. |
The Morpheus provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below:
!> 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.
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"
}
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"
}
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 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
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
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