PR #88 introduce a bug when var.ad_number == nulldata.oci_core_shapes.current_ad cannot be created anymore as local.ADs[(var.ad_number - 1)] generates an error when trying to do an arithmetic operation using null.
We currently rely on var.ad_number == null to provision instances in each AD in a round robin manner when var.instance_count is used.
I propose to restore the old behavior for when var.ad_number is set to null and keep the new behavior (checking shapes on the actual requested AD) when an AD number is specified:
PR #88 introduce a bug when
var.ad_number == null
data.oci_core_shapes.current_ad
cannot be created anymore aslocal.ADs[(var.ad_number - 1)]
generates an error when trying to do an arithmetic operation usingnull
.We currently rely on
var.ad_number == null
to provision instances in each AD in a round robin manner whenvar.instance_count
is used.I propose to restore the old behavior for when
var.ad_number
is set to null and keep the new behavior (checking shapes on the actual requested AD) when an AD number is specified:In the current state, the repo's HEAD is breaking a feature that we rely uppon and cannot be released.
Originally posted by @kral2 in https://github.com/oracle-terraform-modules/terraform-oci-compute-instance/issues/88#issuecomment-1024835569