oracle-terraform-modules/terraform-oci-ocne

Mismatch between values in terraform.tfvars.example and those used by the code

mark-au opened this issue · 3 comments

Mismatch between values in terraform.tfvars.example and values used by modules/network/locals.tf and locals.tf

  • terraform.tfvars.example uses a key of masters for newbits and netnum arrays
  • modules/network/locals.tf and locals.tf use a key of master for newbits and netnum arrays

Unsure if we want to change the example file or the tf files

Example error:

Error: Invalid index

  on modules\network\locals.tf line 8, in locals:
   8:   master_subnet   = cidrsubnet(var.olcne_network_vcn.vcn_cidr, var.olcne_network_vcn.newbits["master"], var.olcne_network_vcn.netnum["master"])
    |----------------
    | var.olcne_network_vcn.newbits is map of number with 6 elements

The given key does not identify an element in this collection value.


Error: Invalid index

  on modules\network\locals.tf line 8, in locals:
   8:   master_subnet   = cidrsubnet(var.olcne_network_vcn.vcn_cidr, var.olcne_network_vcn.newbits["master"], var.olcne_network_vcn.netnum["master"])
    |----------------
    | var.olcne_network_vcn.netnum is map of number with 7 elements

The given key does not identify an element in this collection value.

Changing modules/network/locals.tf and locals.tf is more consistent when considering worker(s) etc.

On resolving above I hit the following.

Error: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: bcfdf9d9ef54e5359aece8381236469a/7F8BE685DA4478EA0E3742F43209E382/0420D03D85955FD3BC2DDE2C94AF21AC

on modules/master/compute.tf line 46, in resource "oci_core_instance_pool" "master":
46: resource "oci_core_instance_pool" "master" {

Also for operator & worker.

Have a peak at the OCI audit logs - I think I saw this when I had permissions to create a OCI instance configurations but no permissions to create OCI instance pools.