Skip to content

Commit

Permalink
updating naming to map and setting v1.0.37 provider
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttyso committed Aug 6, 2023
1 parent ed50ed2 commit acb2293
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 61 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
<!-- END_TF_DOCS -->
6 changes: 3 additions & 3 deletions ip.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand All @@ -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
}
}
6 changes: 3 additions & 3 deletions iqn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand All @@ -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
}
}
6 changes: 3 additions & 3 deletions mac.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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
Expand All @@ -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
}
}
52 changes: 13 additions & 39 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -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 }
}
2 changes: 1 addition & 1 deletion resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
6 changes: 3 additions & 3 deletions uuid.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand All @@ -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
}
}

0 comments on commit acb2293

Please sign in to comment.