-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ideadevice/feat/v4-subnets
* 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
Showing
60 changed files
with
8,853 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.