adarobin / terraform-oci-A1-Always-Free-Instance

MIT License
16 stars 7 forks source link

The given key does not identify an element in this collection value: the collection has no elements. #3

Closed Sparkxxx closed 1 month ago

Sparkxxx commented 1 month ago

Hi,

  1. Created terraform.tfvars in the examples/ubuntu2204 folder with the required credentials.
  2. Ran terraform init
  3. Ran terraform plan that only goes as far as saying that:
    Plan: 29 to add, 0 to change, 0 to destroy.
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/centosstream8.tf line 34, in data "oci_marketplace_listing" "centosstream_8":
    │   34:   listing_id     = data.oci_marketplace_listings.centosstream_8.listings[0].id
    │     ├────────────────
    │     │ data.oci_marketplace_listings.centosstream_8.listings is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/images.tf line 16, in output "oci_aarch64_images_map":
    │   16:       data.oci_core_images.ubuntu-24_04-aarch64.images.0.display_name,
    │     ├────────────────
    │     │ data.oci_core_images.ubuntu-24_04-aarch64.images is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/images.tf line 33, in output "oci_aarch64_images_map":
    │   33:       data.oci_core_images.ubuntu-24_04-aarch64.images.0.id,
    │     ├────────────────
    │     │ data.oci_core_images.ubuntu-24_04-aarch64.images is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/images.tf line 55, in locals:
    │   55:       data.oci_core_images.ubuntu-24_04-aarch64.images.0.display_name,
    │     ├────────────────
    │     │ data.oci_core_images.ubuntu-24_04-aarch64.images is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/images.tf line 72, in locals:
    │   72:       data.oci_core_images.ubuntu-24_04-aarch64.images.0.id,
    │     ├────────────────
    │     │ data.oci_core_images.ubuntu-24_04-aarch64.images is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/images.tf line 111, in locals:
    │  111:         os_image_id  = data.oci_core_images.ubuntu-24_04-aarch64.images.0.id
    │     ├────────────────
    │     │ data.oci_core_images.ubuntu-24_04-aarch64.images is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/ubuntu2404.tf line 20, in output "Ubuntu-24_04-aarch64-latest_name":
    │   20:   value     = data.oci_core_images.ubuntu-24_04-aarch64.images.0.display_name
    │     ├────────────────
    │     │ data.oci_core_images.ubuntu-24_04-aarch64.images is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵
    ╷
    │ Error: Invalid index
    │ 
    │   on .terraform/modules/oci-ampere-a1/ubuntu2404.tf line 26, in output "Ubuntu-24_04-aarch64-latest_ocid":
    │   26:   value     = data.oci_core_images.ubuntu-24_04-aarch64.images.0.id
    │     ├────────────────
    │     │ data.oci_core_images.ubuntu-24_04-aarch64.images is empty list of object
    │ 
    │ The given key does not identify an element in this collection value: the collection has no elements.
    ╵

I think that ubuntu images' names have changed since the last check and centos has been deprecated. Is there something I can do about this to make it work?

Thank you.

Sparkxxx commented 1 month ago

wrong repo, sorry