Skip to content

Commit 2139f9a

Browse files
TF V2.3.0 release branch to add Service Account, Objects Modules (#867)
Co-authored-by: Haroon-Dweikat-Ntx <[email protected]>
1 parent 87ed611 commit 2139f9a

File tree

126 files changed

+5743
-1731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+5743
-1731
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 2.3.0 (July 17, 2025)
2+
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/v2.2.1...v2.3.0)
3+
4+
**New Features:**
5+
- Objects [\#864](https://github.com/nutanix/terraform-provider-nutanix/issues/864)
6+
- CRUD for objects
7+
- Resource for SSL Certificate
8+
- Datasource for SSL Certificate
9+
10+
- Service accounts [\#865](https://github.com/nutanix/terraform-provider-nutanix/issues/865)
11+
- Support of CRU for Service Account
12+
- Support of Datasource to fetch Service Account
13+
- CRUD for User API Key
14+
- Datasource to fetch User API Keys
15+
- Resource to revoke User API Key
16+
117
## 2.2.1 (June 30, 2025)
218
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/v2.2.0...v2.2.1)
319

README.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Terraform provider plugin to integrate with Nutanix Cloud Platform.
44

5-
NOTE: The latest version of the Nutanix provider is [v2.2.1](https://github.com/nutanix/terraform-provider-nutanix/releases/tag/v2.2.1).
5+
NOTE: The latest version of the Nutanix provider is [v2.3.0](https://github.com/nutanix/terraform-provider-nutanix/releases/tag/v2.3.0).
66

77
Modules based on Terraform Nutanix Provider can be found here : [Modules](https://github.com/nutanix/terraform-provider-nutanix/tree/master/modules)
88

@@ -22,34 +22,36 @@ Modules based on Terraform Nutanix Provider can be found here : [Modules](https:
2222
* [Go](https://golang.org/doc/install) 1.17+ (to build the provider plugin)
2323
* This provider uses [SDKv2](https://www.terraform.io/plugin/sdkv2/sdkv2-intro) from release 1.3.0
2424

25-
### Introducing Nutanix Terraform Provider Version 2.2.1
26-
We're excited to announce the release of Nutanix Terraform Provider Version 2.2.1! This update brings significant enhancements and bug fixes to your infrastructure management experience:
27-
28-
- This is a minor release that includes enhancements and bug fixes, aimed at improving stability and reliability.
25+
## Introducing Nutanix Terraform Provider Version v2.3.0
2926

30-
### Introducing Nutanix Terraform Provider Version 2.2.0
31-
We're excited to announce the release of Nutanix Terraform Provider Version 2.2.0! This major update brings significant improvements to your infrastructure management experience:
32-
33-
- It will allow you to interact with Self Service API. With this new plugin support you will be able to launch a Single VM Blueprint to create an Application in Self Service and perform some Day 2 actions like updating application, creating snapshot/restore etc.
27+
We're excited to announce the release of Nutanix Terraform Provider Version 2.3.0! This major update brings new features for automating your Nutanix infrastructure.
28+
29+
### What's New in v2.3.0
30+
31+
- **Built on v4.1 APIs/SDKs**
32+
This release is built on the latest Nutanix v4 APIs and SDKs, providing improved performance, stability, and alignment with the newest platform capabilities.
33+
34+
- **New Resource Support**
35+
- **Objects**: Automate Nutanix Objects (S3-compatible storage) management for scalable storage use cases.
36+
- **Service Accounts**: Manage service accounts directly through Terraform.
37+
38+
---
39+
40+
Upgrade now to take advantage of these powerful features and streamline your Nutanix automation workflows!
3441

35-
### Introducing Nutanix Terraform Provider Version 2.1.0
36-
We're excited to announce the release of Nutanix Terraform Provider Version 2.1.0! This major update brings significant improvements to your infrastructure management experience:
37-
38-
- Built on the latest v4 APIs/SDKs: Leveraging the power of Nutanix v4 APIs/SDKs, this version offers enhanced functionality and better integration with the latest Nutanix features.
39-
- Expanded Resource Coverage: Discover new resources and data sources, enabling you to model and manage a broader spectrum of Nutanix infrastructure components within your Terraform configurations.
40-
- <b>Version Suffix: Modules built based on v4 PC/PE GA sdks are marked with the *_v2 suffix.</b>
4142

4243
### Software Requirements
43-
The provider is used to interact with the many resources and data sources supported by Nutanix, using Prism Central as the provider endpoint. To fully utilize the capabilities of version 2.2.0, ensure your Nutanix environment meets the following software requirements:
44-
- Self Service version: 4.1.0 (Required only for running Self Service based resource and data source)
45-
- AOS Version: 7.0.1, 7.0 or later
46-
- Prism Central Version: pc2024.3, pc2024.3.1 or later
47-
- Nutanix Terraform Provider Version: 2.2.0
44+
The provider is used to interact with the many resources and data sources supported by Nutanix, using Prism Central as the provider endpoint. To fully utilize the capabilities of version 2.3.0, ensure your Nutanix environment meets the following software requirements:
45+
- Self Service version: 4.2.0 (Required only for running Self Service based resource and data source)
46+
- AOS Version: 7.3 or later
47+
- Prism Central Version: pc 7.3 or later
48+
- Nutanix Terraform Provider Version: 2.3.0
4849

4950

5051
## Compatibility Matrix
5152
| Terraform Version | AOS Version | PC version | Other software versions | Supported |
5253
| :--- | :--- | :--- | :--- | :--- |
54+
| 2.3.0 | 7.3 | pc7.3 or later | Self Service v4.2.0, v4.1.0 | yes |
5355
| 2.2.1 | 7.0.1, 7.0 | pc2024.3, pc2024.3.1 or later | | yes |
5456
| 2.2.0 | | | Self Service v4.1.0 | yes |
5557
| 2.1.1 | 7.0.1, 7.0 | pc2024.3, pc2024.3.1 or later | | yes |
@@ -248,6 +250,11 @@ From foundation getting released in 1.5.0-beta, provider configuration will acco
248250
| nutanix_self_service_app_recovery_point | - |
249251
| nutanix_self_service_app_custom_action | - |
250252
| nutanix_self_service_app_restore | - |
253+
| - | nutanix_user_key_v2 |
254+
| - | nutanix_user_key_revoke_v2 |
255+
| - | nutanix_object_store_v2 |
256+
| - | nutanix_object_store_certificate_v2 |
257+
251258

252259

253260
## Data Sources
@@ -377,6 +384,12 @@ From foundation getting released in 1.5.0-beta, provider configuration will acco
377384
| nutanix_blueprint_runtime_editables | - |
378385
| nutanix_self_service_snapshot_policy_list | - |
379386
| nutanix_self_service_app_snapshots | - |
387+
| - | nutanix_user_keys_v2 |
388+
| - | nutanix_user_key_v2 |
389+
| - | nutanix_object_store_v2 |
390+
| - | nutanix_object_stores_v2 |
391+
| - | nutanix_certificate_v2 |
392+
| - | nutanix_certificates_v2 |
380393

381394

382395

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
2+
3+
4+
5+
# This Terraform script will do:
6+
# 1. Deploy an object store with one worker node
7+
# 2. Create Certificate for an object store
8+
# 3. List all certificates for an object store
9+
# 4. Fetch certificate details for an object store
10+
11+
12+
# NOTE:
13+
# 1. Before Deleting object store, make sure to delete buckets inside it
14+
# Currently, we are not supporting delete bucket API in terraform
15+
# 2. Object store Update is used only to resume deployment of object store when it fails,
16+
# the state will be OBJECT_STORE_DEPLOYMENT_FAILED, update will resume the deployment
17+
18+
19+
terraform {
20+
required_providers {
21+
nutanix = {
22+
source = "nutanix/nutanix"
23+
version = "2.3.0"
24+
}
25+
}
26+
}
27+
28+
#defining nutanix configuration
29+
provider "nutanix" {
30+
username = var.nutanix_username
31+
password = var.nutanix_password
32+
endpoint = var.nutanix_endpoint
33+
port = var.nutanix_port
34+
insecure = true
35+
}
36+
37+
# subnet name to be used for object store
38+
locals {
39+
subnetName = "objects.800"
40+
}
41+
42+
# Fetching cluster and subnet details
43+
data "nutanix_clusters_v2" "clusters" {}
44+
45+
data "nutanix_subnets_v2" "subnets" {
46+
filter = "name eq '${local.subnetName}'"
47+
}
48+
49+
# Fetching cluster and subnet ext_id
50+
locals {
51+
clusterExtId = [
52+
for cluster in data.nutanix_clusters_v2.clusters.cluster_entities :
53+
cluster.ext_id if cluster.config[0].cluster_function[0] != "PRISM_CENTRAL"
54+
][0]
55+
subnetExtId = data.nutanix_subnets_v2.subnets.subnets[0].ext_id
56+
}
57+
58+
# Deploying an object store
59+
resource "nutanix_object_store_v2" "example" {
60+
name = "tf-example-os"
61+
description = "terraform create object store example"
62+
deployment_version = "5.1.1"
63+
domain = "msp.pc-idbc.nutanix.com"
64+
num_worker_nodes = 1
65+
cluster_ext_id = local.clusterExtId
66+
total_capacity_gib = 20 * pow(1024, 3) # 20 GB
67+
public_network_reference = local.subnetExtId
68+
public_network_ips {
69+
ipv4 {
70+
value = "10.44.77.123"
71+
}
72+
}
73+
storage_network_reference = local.subnetExtId
74+
storage_network_dns_ip {
75+
ipv4 {
76+
value = "10.44.77.124"
77+
}
78+
}
79+
storage_network_vip {
80+
ipv4 {
81+
value = "10.44.77.125"
82+
}
83+
}
84+
}
85+
86+
# This is example of creating certificate for object store
87+
# check API Ref for more details
88+
# create object_store_cert.json file, file content :]
89+
# {
90+
# "alternateIps": [
91+
# {
92+
# "ipv4": {
93+
# "value": "10.44.77.123"
94+
# }
95+
# }
96+
# ]
97+
# }
98+
99+
# Creating certificate for object store
100+
resource "nutanix_object_store_certificate_v2" "example" {
101+
object_store_ext_id = nutanix_object_store_v2.example.id
102+
# path to certificate json file
103+
path = "./object_store_cert.json"
104+
}
105+
106+
107+
#List all certificates for object store
108+
data "nutanix_certificates_v2" "list" {
109+
object_store_ext_id = nutanix_object_store_v2.example.id
110+
depends_on = [nutanix_object_store_certificate_v2.example]
111+
}
112+
113+
# fetching certificate details for object store
114+
data "nutanix_certificate_v2" "fetch" {
115+
object_store_ext_id = nutanix_object_store_v2.example.id
116+
ext_id = nutanix_object_store_certificate_v2.example.id
117+
depends_on = [nutanix_object_store_certificate_v2.example]
118+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#replace the values as per setup configuration
2+
nutanix_username = "admin"
3+
nutanix_password = "Nutanix/123456"
4+
nutanix_endpoint = "10.xx.xx.xx"
5+
nutanix_port = 9440
6+
7+
#replace this values as per the setup
8+
operationUUID = "00000000-0000-0000-0000-000000000000"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
#variable definitions
3+
variable "nutanix_username" {
4+
type = string
5+
}
6+
variable "nutanix_password" {
7+
type = string
8+
}
9+
variable "nutanix_endpoint" {
10+
type = string
11+
}
12+
variable "nutanix_port" {
13+
type = string
14+
}
15+
variable "operationUUID" {
16+
type = string
17+
}

examples/object_store_v2/main.tf

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
2+
3+
# This Terraform script will do:
4+
# 1. Deploy an object store with one worker node
5+
# 2. List all object stores
6+
# 3. List all object store with filter
7+
# 4. List all object store with limit
8+
# 5. Fetch object store details using ext_id
9+
10+
11+
12+
# NOTE:
13+
# 1. Before Deleting object store, make sure to delete buckets inside it
14+
# Currently, we are not supporting delete bucket API in terraform
15+
# 2. Object store Update is used only to resume deployment of object store when it fails,
16+
# the state will be OBJECT_STORE_DEPLOYMENT_FAILED, update will resume the deployment
17+
18+
19+
terraform {
20+
required_providers {
21+
nutanix = {
22+
source = "nutanix/nutanix"
23+
version = "2.3.0"
24+
}
25+
}
26+
}
27+
28+
#defining nutanix configuration
29+
provider "nutanix" {
30+
username = var.nutanix_username
31+
password = var.nutanix_password
32+
endpoint = var.nutanix_endpoint
33+
port = var.nutanix_port
34+
insecure = true
35+
}
36+
37+
# subnet name to be used for object store
38+
locals {
39+
subnetName = "objects.800"
40+
}
41+
42+
# Fetching cluster and subnet details
43+
data "nutanix_clusters_v2" "clusters" {}
44+
45+
data "nutanix_subnets_v2" "subnets" {
46+
filter = "name eq '${local.subnetName}'"
47+
}
48+
49+
# Fetching cluster and subnet ext_id
50+
locals {
51+
clusterExtId = [
52+
for cluster in data.nutanix_clusters_v2.clusters.cluster_entities :
53+
cluster.ext_id if cluster.config[0].cluster_function[0] != "PRISM_CENTRAL"
54+
][0]
55+
subnetExtId = data.nutanix_subnets_v2.subnets.subnets[0].ext_id
56+
}
57+
58+
# Deploying an object store
59+
resource "nutanix_object_store_v2" "example" {
60+
name = "tf-example-os"
61+
description = "terraform create object store example"
62+
deployment_version = "5.1.1"
63+
domain = "msp.pc-idbc.nutanix.com"
64+
num_worker_nodes = 1
65+
cluster_ext_id = local.clusterExtId
66+
total_capacity_gib = 20 * pow(1024, 3)
67+
public_network_reference = local.subnetExtId
68+
public_network_ips {
69+
ipv4 {
70+
value = "10.44.77.123"
71+
}
72+
}
73+
storage_network_reference = local.subnetExtId
74+
storage_network_dns_ip {
75+
ipv4 {
76+
value = "10.44.77.124"
77+
}
78+
}
79+
storage_network_vip {
80+
ipv4 {
81+
value = "10.44.77.125"
82+
}
83+
}
84+
}
85+
86+
# Deploying Object Store in draft state
87+
resource "nutanix_object_store_v2" "example-draft" {
88+
name = "tf-draft-os"
89+
description = "terraform deploy object store draft example"
90+
deployment_version = "5.1.1"
91+
domain = "msp.pc-idbc.nutanix.com"
92+
num_worker_nodes = 1
93+
cluster_ext_id = local.clusterExtId
94+
total_capacity_gib = 20 * pow(1024, 3)
95+
public_network_reference = local.subnetExtId
96+
state = "UNDEPLOYED_OBJECT_STORE"
97+
public_network_ips {
98+
ipv4 {
99+
value = "10.44.77.126"
100+
}
101+
}
102+
storage_network_reference = local.subnetExtId
103+
storage_network_dns_ip {
104+
ipv4 {
105+
value = "10.44.77.127"
106+
}
107+
}
108+
storage_network_vip {
109+
ipv4 {
110+
value = "10.44.77.128"
111+
}
112+
}
113+
}
114+
115+
# List all object stores
116+
data "nutanix_object_stores_v2" "list" {
117+
depends_on = [nutanix_object_store_v2.example]
118+
}
119+
120+
# List all object stores with filter
121+
data "nutanix_object_stores_v2" "filter" {
122+
filter = "name eq '${nutanix_object_store_v2.example.name}'"
123+
}
124+
125+
# List all object stores with limit
126+
data "nutanix_object_stores_v2" "limit" {
127+
limit = 1
128+
depends_on = [nutanix_object_store_v2.example]
129+
}
130+
131+
# Fetch object store details using ext_id
132+
data "nutanix_object_store_v2" "fetch" {
133+
ext_id = nutanix_object_store_v2.example.id
134+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#replace the values as per setup configuration
2+
nutanix_username = "admin"
3+
nutanix_password = "Nutanix/123456"
4+
nutanix_endpoint = "10.xx.xx.xx"
5+
nutanix_port = 9440
6+
7+
#replace this values as per the setup
8+
operationUUID = "00000000-0000-0000-0000-000000000000"

0 commit comments

Comments
 (0)