From acb2293c69facbee6ff0e8eaf835a70884f209d7 Mon Sep 17 00:00:00 2001 From: scotttyso Date: Sat, 5 Aug 2023 22:57:31 -0400 Subject: [PATCH] updating naming to map and setting v1.0.37 provider --- README.md | 18 +++++++++--------- ip.tf | 6 +++--- iqn.tf | 6 +++--- mac.tf | 6 +++--- outputs.tf | 52 +++++++++++++--------------------------------------- resource.tf | 2 +- uuid.tf | 6 +++--- 7 files changed, 35 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index b94ff2a..271ca98 100644 --- a/README.md +++ b/README.md @@ -60,14 +60,14 @@ No modules. | [intersight_fcpool_pool.wwpn](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fcpool_pool) | resource | | [intersight_fcpool_reservation.wwnn](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fcpool_reservation) | resource | | [intersight_fcpool_reservation.wwpn](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fcpool_reservation) | resource | -| [intersight_ippool_pool.ip](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/ippool_pool) | resource | -| [intersight_ippool_reservation.ip](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/ippool_reservation) | resource | -| [intersight_iqnpool_pool.iqn](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/iqnpool_pool) | resource | -| [intersight_iqnpool_reservation.iqn](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/iqnpool_reservation) | resource | -| [intersight_macpool_pool.mac](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/macpool_pool) | resource | -| [intersight_macpool_reservation.mac](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/macpool_reservation) | resource | -| [intersight_resourcepool_pool.resource](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/resourcepool_pool) | resource | -| [intersight_uuidpool_pool.uuid](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/uuidpool_pool) | resource | -| [intersight_uuidpool_reservation.uuid](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/uuidpool_reservation) | resource | +| [intersight_ippool_pool.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/ippool_pool) | resource | +| [intersight_ippool_reservation.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/ippool_reservation) | resource | +| [intersight_iqnpool_pool.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/iqnpool_pool) | resource | +| [intersight_iqnpool_reservation.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/iqnpool_reservation) | resource | +| [intersight_macpool_pool.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/macpool_pool) | resource | +| [intersight_macpool_reservation.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/macpool_reservation) | resource | +| [intersight_resourcepool_pool.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/resourcepool_pool) | resource | +| [intersight_uuidpool_pool.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/uuidpool_pool) | resource | +| [intersight_uuidpool_reservation.map](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/uuidpool_reservation) | resource | | [intersight_compute_physical_summary.servers](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/data-sources/compute_physical_summary) | data source | \ No newline at end of file diff --git a/ip.tf b/ip.tf index 3f43a17..8ebbc8f 100644 --- a/ip.tf +++ b/ip.tf @@ -4,7 +4,7 @@ # GUI Location: Pools > Create Pool #____________________________________________________________ -resource "intersight_ippool_pool" "ip" { +resource "intersight_ippool_pool" "map" { for_each = local.ip assignment_order = each.value.assignment_order description = each.value.description != "" ? each.value.description : "${each.value.name} IP Pool." @@ -56,7 +56,7 @@ resource "intersight_ippool_pool" "ip" { } } -resource "intersight_ippool_reservation" "ip" { +resource "intersight_ippool_reservation" "map" { for_each = local.ip_reservations allocation_type = each.value.allocation_type # dynamic|static identity = each.value.identity @@ -66,6 +66,6 @@ resource "intersight_ippool_reservation" "ip" { object_type = "organization.Organization" } pool { - moid = intersight_ippool_pool.ip[each.value.pool_name].moid + moid = intersight_ippool_pool.map[each.value.pool_name].moid } } diff --git a/iqn.tf b/iqn.tf index fbc7e03..566084b 100644 --- a/iqn.tf +++ b/iqn.tf @@ -4,7 +4,7 @@ # GUI Location: Pools > Create Pool #____________________________________________________________ -resource "intersight_iqnpool_pool" "iqn" { +resource "intersight_iqnpool_pool" "map" { for_each = local.iqn assignment_order = each.value.assignment_order description = each.value.description != "" ? each.value.description : "${each.value.name} IQN Pool." @@ -32,7 +32,7 @@ resource "intersight_iqnpool_pool" "iqn" { } } -resource "intersight_iqnpool_reservation" "iqn" { +resource "intersight_iqnpool_reservation" "map" { for_each = local.mac_reservations allocation_type = each.value.allocation_type # dynamic|static identity = each.value.identity @@ -41,6 +41,6 @@ resource "intersight_iqnpool_reservation" "iqn" { object_type = "organization.Organization" } pool { - moid = intersight_iqnpool_pool.iqn[each.value.pool_name].moid + moid = intersight_iqnpool_pool.map[each.value.pool_name].moid } } diff --git a/mac.tf b/mac.tf index 8b0e950..d4d44c7 100644 --- a/mac.tf +++ b/mac.tf @@ -4,7 +4,7 @@ # GUI Location: Pools > Create Pool #____________________________________________________________ -resource "intersight_macpool_pool" "mac" { +resource "intersight_macpool_pool" "map" { for_each = local.mac assignment_order = each.value.assignment_order description = each.value.description != "" ? each.value.description : "${each.value.name} MAC Pool." @@ -31,7 +31,7 @@ resource "intersight_macpool_pool" "mac" { } } -resource "intersight_macpool_reservation" "mac" { +resource "intersight_macpool_reservation" "map" { for_each = local.mac_reservations allocation_type = each.value.allocation_type # dynamic|static identity = each.value.identity @@ -40,6 +40,6 @@ resource "intersight_macpool_reservation" "mac" { object_type = "organization.Organization" } pool { - moid = intersight_macpool_pool.mac[each.value.pool_name].moid + moid = intersight_macpool_pool.map[each.value.pool_name].moid } } diff --git a/outputs.tf b/outputs.tf index 0f9d744..e42ecac 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,90 +1,64 @@ output "ip" { description = "Moids of the IP Pools." - value = length(local.ip) > 0 ? { for v in sort( - keys(intersight_ippool_pool.ip) - ) : v => intersight_ippool_pool.ip[v].moid } : {} + value = { for v in sort(keys(intersight_ippool_pool.map)) : v => intersight_ippool_pool.map[v].moid } } output "ip_reservations" { description = "Moids of the IP Pool Reservations." - value = length(local.ip_reservations) > 0 ? { for v in sort( - keys(intersight_ippool_reservation.ip) - ) : v => intersight_ippool_reservation.ip[v].moid } : {} + value = { for v in sort(keys(intersight_ippool_reservation.map)) : v => intersight_ippool_reservation.map[v].moid } } output "iqn" { description = "Moids of the IQN Pools." - value = length(local.iqn) > 0 ? { for v in sort( - keys(intersight_iqnpool_pool.iqn) - ) : v => intersight_iqnpool_pool.iqn[v].moid } : {} + value = { for v in sort(keys(intersight_iqnpool_pool.map)) : v => intersight_iqnpool_pool.map[v].moid } } output "iqn_reservations" { description = "Moids of the IQN Pool Reservations." - value = length(local.iqn_reservations) > 0 ? { for v in sort( - keys(intersight_iqnpool_reservation.iqn) - ) : v => intersight_iqnpool_reservation.iqn[v].moid } : {} + value = { for v in sort(keys(intersight_iqnpool_reservation.map)) : v => intersight_iqnpool_reservation.map[v].moid } } output "mac" { description = "Moids of the MAC Pools." - value = length(local.mac) > 0 ? { for v in sort( - keys(intersight_macpool_pool.mac) - ) : v => intersight_macpool_pool.mac[v].moid } : {} + value = { for v in sort(keys(intersight_macpool_pool.map)) : v => intersight_macpool_pool.map[v].moid } } output "mac_reservations" { description = "Moids of the MAC Pool Reservations." - value = length(local.mac_reservations) > 0 ? { for v in sort( - keys(intersight_macpool_reservation.mac) - ) : v => intersight_macpool_reservation.mac[v].moid } : {} + value = { for v in sort(keys(intersight_macpool_reservation.map)) : v => intersight_macpool_reservation.map[v].moid } } output "resource" { description = "Moids of the Resource Pools." - value = length(local.resource) > 0 ? { for v in sort( - keys(intersight_resourcepool_pool.resource) - ) : v => intersight_resourcepool_pool.resource[v].moid } : {} + value = { for v in sort(keys(intersight_resourcepool_pool.map)) : v => intersight_resourcepool_pool.map[v].moid } } output "uuid" { description = "Moids of the UUID Pools." - value = length(local.uuid) > 0 ? { for v in sort( - keys(intersight_uuidpool_pool.uuid) - ) : v => intersight_uuidpool_pool.uuid[v].moid } : {} + value = { for v in sort(keys(intersight_uuidpool_pool.map)) : v => intersight_uuidpool_pool.map[v].moid } } output "uuid_reservations" { description = "Moids of the UUID Pool Reservations." - value = length(local.uuid_reservations) > 0 ? { for v in sort( - keys(intersight_uuidpool_reservation.uuid) - ) : v => intersight_uuidpool_reservation.uuid[v].moid } : {} + value = { for v in sort(keys(intersight_uuidpool_reservation.map)) : v => intersight_uuidpool_reservation.map[v].moid } } output "wwnn" { description = "Moids of the WWNN Pools." - value = length(local.wwnn) > 0 ? { for v in sort( - keys(intersight_fcpool_pool.wwnn) - ) : v => intersight_fcpool_pool.wwnn[v].moid } : {} + value = { for v in sort(keys(intersight_fcpool_pool.wwnn)) : v => intersight_fcpool_pool.wwnn[v].moid } } output "wwnn_reservations" { description = "Moids of the WWNN Pool Reservations." - value = length(local.wwnn_reservations) > 0 ? { for v in sort( - keys(intersight_fcpool_reservation.wwnn) - ) : v => intersight_fcpool_reservation.wwnn[v].moid } : {} + value = { for v in sort(keys(intersight_fcpool_reservation.wwnn)) : v => intersight_fcpool_reservation.wwnn[v].moid } } output "wwpn" { description = "Moids of the WWPN Pools." - value = length(local.wwpn) > 0 ? { for v in sort( - keys(intersight_fcpool_pool.wwpn) - ) : v => intersight_fcpool_pool.wwpn[v].moid } : {} + value = { for v in sort(keys(intersight_fcpool_pool.wwpn)) : v => intersight_fcpool_pool.wwpn[v].moid } } output "wwpn_reservations" { description = "Moids of the WWPN Pool Reservations." - value = length(local.wwpn_reservations) > 0 ? { for v in sort( - keys(intersight_fcpool_reservation.wwpn) - ) : v => intersight_fcpool_reservation.wwpn[v].moid } : {} + value = { for v in sort(keys(intersight_fcpool_reservation.wwpn)) : v => intersight_fcpool_reservation.wwpn[v].moid } } diff --git a/resource.tf b/resource.tf index 0f2760f..3f04877 100644 --- a/resource.tf +++ b/resource.tf @@ -16,7 +16,7 @@ data "intersight_compute_physical_summary" "servers" { # GUI Location: Pools > Create Pool > Resource Pool #____________________________________________________________ -resource "intersight_resourcepool_pool" "resource" { +resource "intersight_resourcepool_pool" "map" { for_each = local.resource assignment_order = each.value.assignment_order description = each.value.description != "" ? each.value.description : "${each.value.name} Resource Pool." diff --git a/uuid.tf b/uuid.tf index 476ffff..d9f9876 100644 --- a/uuid.tf +++ b/uuid.tf @@ -4,7 +4,7 @@ # GUI Location: Pools > Create Pool #____________________________________________________________ -resource "intersight_uuidpool_pool" "uuid" { +resource "intersight_uuidpool_pool" "map" { for_each = local.uuid assignment_order = each.value.assignment_order description = each.value.description != "" ? each.value.description : "${each.value.name} UUID Pool." @@ -32,7 +32,7 @@ resource "intersight_uuidpool_pool" "uuid" { } } -resource "intersight_uuidpool_reservation" "uuid" { +resource "intersight_uuidpool_reservation" "map" { for_each = local.mac_reservations allocation_type = each.value.allocation_type # dynamic|static identity = each.value.identity @@ -41,6 +41,6 @@ resource "intersight_uuidpool_reservation" "uuid" { object_type = "organization.Organization" } pool { - moid = intersight_uuidpool_pool.uuid[each.value.pool_name].moid + moid = intersight_uuidpool_pool.map[each.value.pool_name].moid } }