Skip to content

Commit

Permalink
Merge pull request #162 from Juniper/bug/161
Browse files Browse the repository at this point in the history
Bug 161: use `initial_interface_map_id` in example
  • Loading branch information
chrismarget-j authored Jun 24, 2023
2 parents 332c5b3 + 40ada8c commit 4dc5a0e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
32 changes: 17 additions & 15 deletions docs/resources/datacenter_device_allocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,43 @@ resource "apstra_datacenter_blueprint" "r" {
template_id = "L2_Virtual_EVPN"
}
# Only one of "device_key" and "interface_map_id" is required in most cases.
# Only one of "device_key" and "initial_interface_map_id" is required in
# most cases.
#
# When only the interface_map_id is provided, we set the interface map (this
# step eliminates build errors), but do not assign systems by ID.
# When only the initial_interface_map_id is provided, we set the interface
# map (this step eliminates build errors), but do not assign systems by ID.
#
# When only the device_key is provided, we try to infer the interface_map_id
# by first determining the device type, and then looking for candidate
# interface maps which can map the specific hardware to the logical device
# specified by the fabric role. When multiple candidate interface maps exist
# supplying interface_map_id becomes mandatory.
# When only the device_key is provided, we try to infer the
# initial_interface_map_id by first determining the device type, and then
# looking for candidate interface maps which can map the specific hardware
# to the logical device specified by the fabric role. When multiple
# candidate interface maps exist supplying interface_map_id becomes
# mandatory.
locals {
switches = {
spine1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
}
spine2 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
}
l2_virtual_001_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
l2_virtual_002_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
l2_virtual_003_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
l2_virtual_004_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
}
}
Expand All @@ -64,7 +66,7 @@ locals {
resource "apstra_datacenter_device_allocation" "r" {
for_each = local.switches
blueprint_id = apstra_datacenter_blueprint.r.id
initial_interface_map_id = each.value["interface_map_id"]
initial_interface_map_id = each.value["initial_interface_map_id"]
node_name = each.key
deploy_mode = "deploy"
}
Expand Down
32 changes: 17 additions & 15 deletions examples/resources/apstra_datacenter_device_allocation/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,43 @@ resource "apstra_datacenter_blueprint" "r" {
template_id = "L2_Virtual_EVPN"
}

# Only one of "device_key" and "interface_map_id" is required in most cases.
# Only one of "device_key" and "initial_interface_map_id" is required in
# most cases.
#
# When only the interface_map_id is provided, we set the interface map (this
# step eliminates build errors), but do not assign systems by ID.
# When only the initial_interface_map_id is provided, we set the interface
# map (this step eliminates build errors), but do not assign systems by ID.
#
# When only the device_key is provided, we try to infer the interface_map_id
# by first determining the device type, and then looking for candidate
# interface maps which can map the specific hardware to the logical device
# specified by the fabric role. When multiple candidate interface maps exist
# supplying interface_map_id becomes mandatory.
# When only the device_key is provided, we try to infer the
# initial_interface_map_id by first determining the device type, and then
# looking for candidate interface maps which can map the specific hardware
# to the logical device specified by the fabric role. When multiple
# candidate interface maps exist supplying interface_map_id becomes
# mandatory.
locals {
switches = {
spine1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
}
spine2 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Spine"
}
l2_virtual_001_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
l2_virtual_002_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
l2_virtual_003_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
l2_virtual_004_leaf1 = {
# device_key = "<serial-number-goes-here>"
interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
initial_interface_map_id = "Juniper_vQFX__AOS-7x10-Leaf"
}
}
}
Expand All @@ -50,7 +52,7 @@ locals {
resource "apstra_datacenter_device_allocation" "r" {
for_each = local.switches
blueprint_id = apstra_datacenter_blueprint.r.id
initial_interface_map_id = each.value["interface_map_id"]
initial_interface_map_id = each.value["initial_interface_map_id"]
node_name = each.key
deploy_mode = "deploy"
}

0 comments on commit 4dc5a0e

Please sign in to comment.