Skip to content

Commit

Permalink
Merge pull request #11 from ideadevice/feat/v4-subnets
Browse files Browse the repository at this point in the history
* Feat/1.9.3 (#633)

Co-authored-by: Abhishekism9450 <[email protected]>
Co-authored-by: Deepak Muley <[email protected]>
Co-authored-by: Abhishek <[email protected]>

* Feat/1.9.4 (#645)

Co-authored-by: Frederic M <[email protected]>
Co-authored-by: ArtemProt <[email protected]>
Co-authored-by: Abhishekism9450 <[email protected]>

* new tf design

* import changes

* package name change for fc

* package name for fc is foundationCentral

* package name to foundationcentral

* fixes around acctest

* examples folder

* v4 design

* some fixes after merging

* datasource for subnets,vpcs, fips

* resource for subnets

* adding go mod for public repo

* lint fixes

* lint fix

* lint fix for client name

* test config as client will be different for sdks

* adding crud for fips

* test for subnet

* docs for subnet

* tcs for fips

* lint fixes

* lint fix in fips

* lint fix

* docs for fip

* docs and tcs for vpc

* delete vendor and exclude vendor folder

* change the subnets, floating_ip and vpc module name from v4 to v2, add examples

* fix acc test cases for resource services

* fix acc test cases for datasource services, use internal sdk, create the resources that test cases needed within the test case itself

* change package name from networking to networkingv2

* Revert "delete vendor and exclude vendor folder"

This reverts commit 34ac198.

---------

Co-authored-by: Abhishek Chaudhary <[email protected]>
Co-authored-by: Abhishekism9450 <[email protected]>
Co-authored-by: Abhishek <[email protected]>
  • Loading branch information
3 people authored Sep 4, 2024
2 parents 14c9f4c + 06ccf5e commit 518378f
Show file tree
Hide file tree
Showing 60 changed files with 8,853 additions and 21 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
## 1.9.4 (October 27, 2023)
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/feat/1.9.3...feat/1.9.4)

- Feat branch. [\#645](https://github.com/nutanix/terraform-provider-nutanix/pull/645)

**Merged pull request:**
- Change VM name should not require VM PowerOFF. [\#626](https://github.com/nutanix/terraform-provider-nutanix/pull/626)
- Fix: compare bootconfig against previous value. [\#641](https://github.com/nutanix/terraform-provider-nutanix/pull/641)

**Implemented enhancements:**
- Added example to use metadata in nutanix subnets. [\#643](https://github.com/nutanix/terraform-provider-nutanix/pull/643)
- External subnet name/uuid are Optional args not Required. [\#644](https://github.com/nutanix/terraform-provider-nutanix/pull/644)

**Fixed bugs:**
- VM rebooted at every change because of hotPlugChange set to false. [\#640](https://github.com/nutanix/terraform-provider-nutanix/issues/640)
- Changing the VM name forces a reboot. [\#625](https://github.com/nutanix/terraform-provider-nutanix/issues/625)

**Closed issues:**
- Modify Terraform documentation for nutanix_vpc resource. [\#636](https://github.com/nutanix/terraform-provider-nutanix/issues/636)
- Include metadata example for data.nutanix_subnets. [\#590](https://github.com/nutanix/terraform-provider-nutanix/issues/590)


## 1.9.3 (September 7, 2023)
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/feat/1.9.2...feat/1.9.3)

**Merged pull request:**
- Setting machine type in updating virtual machines. [\#630](https://github.com/nutanix/terraform-provider-nutanix/pull/630)
- Added examples of role creation using nutanix terraform provider. [\#632](https://github.com/nutanix/terraform-provider-nutanix/pull/632)

**Fixed bugs:**
- Updating gives error: Machine type must be set to Q35 for secure boot. [\#622](https://github.com/nutanix/terraform-provider-nutanix/issues/622)
- Machine type must be set to Q35 for secure boot. [\#494](https://github.com/nutanix/terraform-provider-nutanix/issues/494)

**Closed issues:**
- Add support documentation in terraform. [\#611](https://github.com/nutanix/terraform-provider-nutanix/issues/611)

**Closed pull request:**
- Fix Secure boot VMs when doing updates. [\#496](https://github.com/nutanix/terraform-provider-nutanix/pull/496)


## 1.9.2 (July 21, 2023)
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/feat/1.9.1...feat/1.9.2)

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Terraform provider plugin to integrate with Nutanix Enterprise Cloud

NOTE: The latest version of the Nutanix provider is [v1.9.2](https://github.com/nutanix/terraform-provider-nutanix/releases/tag/v1.9.2)
NOTE: The latest version of the Nutanix provider is [v1.9.4](https://github.com/nutanix/terraform-provider-nutanix/releases/tag/v1.9.4)

Modules based on Terraform Nutanix Provider can be found here : [Modules](https://github.com/nutanix/terraform-provider-nutanix/tree/master/modules)
## Build, Quality Status
Expand Down Expand Up @@ -52,6 +52,8 @@ The Terraform Nutanix provider is designed to work with Nutanix Prism Central an
> For the 1.9.0 release of the provider it will have N-1 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc2022.9 and pc2023.1.0.1.
> For the 1.9.4 release of the provider it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc2023.3, pc2023.1.0.2 and pc2023.1.0.1.
### note
With v1.6.1 release of flow networking feature in provider, IAMv2 setups would be mandate.
Also, there is known issue for access_control_policies resource where update would be failing. We are continuously tracking the issue internally.
Expand Down
84 changes: 84 additions & 0 deletions examples/floating_ip_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
terraform{
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "1.6.0"
}
}
}

#definig nutanix configuration
provider "nutanix"{
username = var.nutanix_username
password = var.nutanix_password
endpoint = var.nutanix_endpoint
port = 9440
insecure = true
}


# create Floating IP with External Subnet UUID
resource "nutanix_floating_ip_v2" "fip1" {
name = "example-fip"
description = "example fip description"
external_subnet_reference = "{{ext_sub_uuid}}"
}


# create Floating IP with vpc UUID with external subnet uuid

resource "nutanix_floating_ip_v2" "fip2" {
name = "example-fip"
description = "example fip description"
external_subnet_reference_uuid = "{{ext_sub_uuid}}"
vpc_reference_uuid= "{{vpc_uuid}}"
association{
private_ip_association{
vpc_reference = "{{vpc_uuid}}"
private_ip{
ipv4{
value = "10.44.44.7"
}
}
}
}
}

# create Floating IP with External Subnet with vm

resource "nutanix_floating_ip" "fip3" {
name = "example-fip"
description = "example fip description"
external_subnet_reference_uuid = "{{ext_sub_uuid}}"
association{
vm_nic_association{
vm_nic_reference = "{{vm_nic_uuid}}"
}
}
}

# data source floating IP

data "nutanix_floating_ip_v2" "fip4"{
floating_ip_uuid = "{{floating_ip_uuid}}"
}

# list of floating IPs

data "nutanix_floating_ips_v2" "fip5"{ }

output "csf1" {
value = data.nutanix_floating_ips_v2.fip5
}



data "nutanix_floating_ips_v2" "fip6"{
metadata{
filter = "name eq 'example-fip'"
}
}

output "csf2" {
value = data.nutanix_floating_ips_v2.fip6
}
5 changes: 5 additions & 0 deletions examples/floating_ip_v2/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define values to the variables to be used in terraform file
nutanix_username = "admin"
nutanix_password = "password"
nutanix_endpoint = "10.xx.xx.xx"
nutanix_port = 9440
13 changes: 13 additions & 0 deletions examples/floating_ip_v2/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define the type of variables to be used in terraform file
variable "nutanix_username" {
type = string
}
variable "nutanix_password" {
type = string
}
variable "nutanix_endpoint" {
type = string
}
variable "nutanix_port" {
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ terraform {
}

// initialize vault. This internally uses VAULT_ADDR & VAULT_TOKEN environment variables for authentication
provider "vault" {}
provider "vault" {
address = "{{ address }}"
}

// initialize nutanix provider
provider "nutanix" {
Expand Down
2 changes: 1 addition & 1 deletion examples/ndb/clone_refresh/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ resource "nutanix_ndb_clone_refresh" "acctest-managed"{

resource "nutanix_ndb_clone_refresh" "acctest-managed"{
clone_id = "{{ clone_id }}"
user_pitr_stamp = "{{ timestamp }}"
user_pitr_timestamp = "{{ timestamp }}"
timezone = "Asia/Calcutta"
}
77 changes: 77 additions & 0 deletions examples/role/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
provider "nutanix" {
username = var.user
password = var.password
endpoint = var.endpoint
insecure = var.insecure
port = var.port
wait_timeout = 60
}

# Create Kubernetes Infrastructure Provision role
# ---------------
data "nutanix_permission" "k8s_infra_provision_permissions" {
for_each = toset(var.k8s_infra_provision_permissions)
permission_name = each.key
}

resource "nutanix_role" "kubernetes_infrastructure_provision" {
name = "Kubernetes Infrastructure Provision"
description = "Access for Kubernetes cluster infrastructure VMs resources"
dynamic "permission_reference_list" {
for_each = data.nutanix_permission.k8s_infra_provision_permissions
content {
kind = "permission"
uuid = permission_reference_list.value.id
}
}
}

data "nutanix_role" "kubernetes_infrastructure_provision" {
role_id = nutanix_role.kubernetes_infrastructure_provision.id
}

# Create CSI System role
# ---------------
data "nutanix_permission" "csi_system_role_permissions" {
for_each = toset(var.csi_system_role_permissions)
permission_name = each.key
}

resource "nutanix_role" "csi_system" {
name = "CSI System"
description = "Full access for Kubernetes cluster infrastructure resources for CSI"
dynamic "permission_reference_list" {
for_each = data.nutanix_permission.csi_system_role_permissions
content {
kind = "permission"
uuid = permission_reference_list.value.id
}
}
}

data "nutanix_role" "csi_system" {
role_id = nutanix_role.csi_system.id
}

# Create Kubernetes Data Services System role
# ---------------
data "nutanix_permission" "k8s_data_services_system_role_permissions" {
for_each = toset(var.k8s_data_services_system_role_permissions)
permission_name = each.key
}

resource "nutanix_role" "k8s_data_services_system" {
name = "Kubernetes Data Services System"
description = "Full access for Kubernetes cluster infrastructure resources for Kubernetes Data Services"
dynamic "permission_reference_list" {
for_each = data.nutanix_permission.k8s_data_services_system_role_permissions
content {
kind = "permission"
uuid = permission_reference_list.value.id
}
}
}

data "nutanix_role" "k8s_data_services_system" {
role_id = nutanix_role.k8s_data_services_system.id
}
11 changes: 11 additions & 0 deletions examples/role/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
output "k8s_infra_provision_role_id" {
value = data.nutanix_role.kubernetes_infrastructure_provision.id
}

output "k8s_data_services_system_role_id" {
value = data.nutanix_role.k8s_data_services_system.id
}

output "csi_system_role_id" {
value = data.nutanix_role.csi_system.id
}
Loading

0 comments on commit 518378f

Please sign in to comment.