Skip to content

Commit

Permalink
V4 networks on v4-temp-design (#19)
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.

* Feat/v4 pbrs  on v4 networks  (#13)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* tests and docs for pbrs

* change module  name from v4 to v2

* change package  name to networkingv2

* add pbr_v2 example

* fix import

---------

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

* Feat/v4 static routes on v4 networks  (#14)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* datasourc for route tables

* resource for static route

* tests and docs for pbrs

* docs for route table

* docs for static route

* lint fixes

* remove other services

* change module name from v4 to v2

* change package name to networkingv2

* change package name to networkingv2

* remove other services

---------

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

* Feat/v4 network security rules on v4 networks  (#15)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* datasourc for route tables

* resource for static route

* address groups v4

* service groups

* resource for service groups

* crud for service groups

* CRUD for address groups

* data source for network security

* CRUD for network security

* tests and docs for pbrs

* docs for route table

* docs for static route

* lint fixes

* testcases for address groups

* fixing lint issues

* lint fix

* docs for address groups

* test and docs for service groups

* docs and tcs for NSP

* resource tests for NSP

* tcs for NSP

* remove other services

* change module name from v4 to v2

* change package name to networkingv2

---------

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

* Feat/v4 address group on v4 networks  (#16)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* datasourc for route tables

* resource for static route

* address groups v4

* service groups

* resource for service groups

* crud for service groups

* CRUD for address groups

* tests and docs for pbrs

* docs for route table

* docs for static route

* lint fixes

* testcases for address groups

* fixing lint issues

* lint fix

* docs for address groups

* test and docs for service groups

* add examples for address group and service group

* add examples for address group and service group

* add examples for address group and service group

* Revert "add examples for address group and service group"

This reverts commit 4c1cc92f031ae60a97604a17a374fd2930b21acb.

* remove other modules

* change module name from v4 to v2

* change package name from v2

---------

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

---------

Co-authored-by: Abhishek Chaudhary <[email protected]>
Co-authored-by: Abhishekism9450 <[email protected]>
Co-authored-by: Deepak Muley <[email protected]>
Co-authored-by: Abhishek <[email protected]>
Co-authored-by: Frederic M <[email protected]>
Co-authored-by: ArtemProt <[email protected]>
  • Loading branch information
7 people authored Sep 9, 2024
1 parent 40a3c7b commit 91afc14
Show file tree
Hide file tree
Showing 112 changed files with 18,171 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
37 changes: 37 additions & 0 deletions examples/address_group_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
terraform{
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "1.7.0"
}
}
}

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

# Add Address group.
resource "nutanix_address_groups_v2" "example_1" {
name = "address_group"
description = "address group description"
ipv4_addresses{
value = "10.0.0.0"
prefix_length = 24
}
}

# Add Address group. with ip range
resource "nutanix_address_groups_v2" "example_2" {
name = "address_group"
description = "address group description"
ip_ranges{
start_ip = "10.0.0.1"
end_ip = "10.0.0.10"
}
}
5 changes: 5 additions & 0 deletions examples/address_group_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/address_group_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
}
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"
}
118 changes: 118 additions & 0 deletions examples/pbr_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
terraform{
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "1.6.0"
}
}
}

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

# create PBR with vpc name with any source or destination or protocol with permit action

resource "nutanix_pbr_v2" "pbr1" {
name = "%[1]s"
description = "%[2]s"
vpc_ext_id = var.vpc_reference_uuid
priority = 14
policies{
policy_match{
source{
address_type = "ANY"
}
destination{
address_type = "ANY"
}
protocol_type = "UDP"
}
policy_action{
action_type = "PERMIT"
}
}
}



# create PBR with vpc uuid with source external

resource "nutanix_pbr_v2" "pbr2" {
name = "%[1]s"
description = "%[2]s"
vpc_ext_id = var.vpc_reference_uuid
priority = 11
policies{
policy_match{
source{
address_type = "EXTERNAL"
}
destination{
address_type = "SUBNET"
subnet_prefix{
ipv4{
ip{
value= "10.10.10.0"
prefix_length = 24
}
}
}
}
protocol_type = "ANY"
}
policy_action{
action_type = "FORWARD"
nexthop_ip_address{
ipv4{
value = "10.10.10.10"
}
}
}
}
}


#create PBR with vpc name with source Any and destination external
resource "nutanix_pbr_v2" "pbr3" {
name = "%[1]s"
description = "%[2]s"
vpc_ext_id = var.vpc_reference_uuid
priority = 14
policies{
policy_match{
source{
address_type = "ALL"
}
destination{
address_type = "INTERNET"
}
protocol_type = "UDP"
}
policy_action{
action_type = "PERMIT"
}
}
}

# list pbr

data "nutanix_pbrs_v2" "pbr4" {
}



# get an entity with pbr uuid

data "nutanix_pbr_v2" "pbr5" {
ext_id = resource.nutanix_pbr_v2.rtest.ext_id
depends_on = [
resource.nutanix_pbr_v2.rtest
]
}

6 changes: 6 additions & 0 deletions examples/pbr_v2/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#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
vpc_reference_uuid = "<vpc_uuid>"
17 changes: 17 additions & 0 deletions examples/pbr_v2/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#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
}

variable "vpc_reference_uuid" {
type = string
}
Loading

0 comments on commit 91afc14

Please sign in to comment.