AmpereComputing / terraform-oci-ampere-a1

Terraform for launching OCI Ampere A1 Instances
Apache License 2.0
15 stars 8 forks source link

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

Open Sparkxxx opened 7 hours ago

Sparkxxx commented 7 hours 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.

ppouliot commented 6 hours ago

Strangely enough I fixed it yesterday. Start from a clean directory or update the module it should work now.

On Fri, Sep 27, 2024, 12:44 PM Sparkxxx @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/AmpereComputing/terraform-oci-ampere-a1/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALXJ4OAPKSAXJDELN5ONCLZYWDNDAVCNFSM6AAAAABO7QQVY2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGU2TGMZUGA2TQOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>