You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Some tests need setup related constants forresource creation. So add/replace detailsin test_config.json (for pc tests) and test_foundation_config.json (for foundation and foundation central tests and NDB)
Copy file name to clipboardExpand all lines: README.md
+26-10Lines changed: 26 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,13 +108,16 @@ Long term, once this is upstream, no pre-compiled binaries will be needed, as te
108
108
The following keys can be used to configure the provider.
109
109
110
110
***endpoint** - (Required) IP address for the Nutanix Prism Central.
111
-
***username** - (Required) Username for Nutanix Prism Central. Could be local cluster auth (e.g. `auth`) or directory auth.
112
-
***password** - (Required) Password for the provided username.
113
-
***port** - (Optional) Port for the Nutanix Prism Central. Default port is 9440.
111
+
***username** - (Optional) Username for Nutanix Prism Central. Could be local cluster auth (e.g. `auth`) or directory auth. Required if `api_key` is not set.
112
+
***password** - (Optional) Password for the provided username. Required if `api_key` is not set.
113
+
***api_key** - (Optional) API key for Prism Central authentication. Can be used as an alternative to `username`/`password` when connecting to a Prism Central instance. **Not supported by Prism Elements**, which requires `username` and `password`. When set, the `X-Ntnx-Api-Key` header is used instead of Basic Authentication.
114
+
***port** - (Optional) Port for the Nutanix Prism Central. Default port is 9440. Can also be set via the `NUTANIX_PORT` environment variable.
114
115
***insecure** - (Optional) Explicitly allow the provider to perform insecure SSL requests. If omitted, default value is false.
115
-
***wait_timeout** - (optional) Set if you know that the creation o update of a resource may take long time (minutes).
116
+
***wait_timeout** - (Optional) Set if you know that the creation or update of a resource may take long time (minutes).
117
+
***custom_headers** - (Optional) Map of custom HTTP headers to add to all API requests. Useful for environments that require additional headers such as Cloudflare Access service tokens. Headers can also be set via environment variables with the `NUTANIX_HEADER_` prefix (e.g. `NUTANIX_HEADER_CF_ACCESS_CLIENT_ID` becomes `Cf-Access-Client-Id`). Values defined in config take precedence over environment variables.
116
118
117
119
```hcl
120
+
# Basic authentication
118
121
provider "nutanix" {
119
122
username = "admin"
120
123
password = "myPassword"
@@ -123,9 +126,22 @@ provider "nutanix" {
123
126
insecure = true
124
127
wait_timeout = 10
125
128
}
129
+
130
+
# API key authentication with custom headers (e.g. Cloudflare Access)
131
+
provider "nutanix" {
132
+
api_key = "my-api-key"
133
+
port = 443
134
+
endpoint = "10.36.7.201"
135
+
insecure = true
136
+
wait_timeout = 10
137
+
custom_headers = {
138
+
"Cf-Access-Client-Id" = "my-client-id"
139
+
"Cf-Access-Client-Secret" = "my-client-secret"
140
+
}
141
+
}
126
142
```
127
143
128
-
## From terraform-provider-nutanix v1.5.0-beta :
144
+
## From terraform-provider-nutanix v1.5.0-beta
129
145
130
146
The following keys can be used to configure the provider.
131
147
@@ -151,7 +167,7 @@ provider "nutanix" {
151
167
}
152
168
```
153
169
154
-
## Additional fields for using Nutanix Database Service:
170
+
## Additional fields for using Nutanix Database Service
155
171
156
172
***ndb_username** - (Optional) Username of Nutanix Database Service server
157
173
***ndb_password** - (Optional) Password of Nutanix Database Service server
From foundation getting released in 1.5.0-beta, provider configuration will accomodate prism central and foundation apis connection details. **It will show warnings for disabled api connections as per the attributes given in provider configuration in above mentioned format**. The below are the required attributes for corresponding provider componenets :
170
-
* endpoint, username and passwordare required fields for using Prism Central & Karbon based resources and data sources
171
-
* foundation_endpoint is required field for using Foundation based resources and data sources
172
-
* ndb_username, ndb_password and ndb_endpoint are required fields for using NDB based resources and data sources
185
+
From foundation getting released in 1.5.0-beta, provider configuration will accommodate Prism Central and foundation API connection details. **It will show warnings for disabled API connections as per the attributes given in provider configuration in above mentioned format**. The below are the required attributes for corresponding provider components:
186
+
*`endpoint` and either (`username` + `password`) or `api_key`are required for using Prism Central & Karbon based resources and data sources.
187
+
*`foundation_endpoint` is required field for using Foundation based resources and data sources
188
+
*`ndb_username`, `ndb_password` and `ndb_endpoint` are required fields for using NDB based resources and data sources
t.Fatal("`NUTANIX_USERNAME`,`NUTANIX_PASSWORD`,`NUTANIX_INSECURE`,`NUTANIX_PORT`,`NUTANIX_ENDPOINT`, `NUTANIX_STORAGE_CONTAINER` must be set for acceptance testing")
44
+
t.Fatal("`NUTANIX_INSECURE`,`NUTANIX_PORT`,`NUTANIX_ENDPOINT`,`NUTANIX_STORAGE_CONTAINER` must be set for acceptance testing")
45
+
}
46
+
47
+
// Check authentication - either username/password OR api_key must be set
0 commit comments