oracle-terraform-modules/terraform-oci-oke

Terraform module oci_oke broken: oci_core_images data source returning empty images for bastion

maxmuthu opened this issue ยท 5 comments

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

Affected Resource(s)

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. 
# Please remove any sensitive information from configuration files before sharing them. 

Debug Output

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

Please see customer note and let me know, if you need more info on this. Thanks.

we are using terraform module https://github.com/oracle-terraform-modules/terraform-oci-oke at v5.0.3
Our Spacelift (automated tf state management) detected drift and found that the tf module is unable to plan now due to unable to find any image IDs for bastion.

I've created and applied this data source
data "oci_core_images" "bastion" {
// compartment_id = data.terraform_remote_state.oci_core.outputs.root_tenancy_ocid
compartment_id = data.terraform_remote_state.oci_core.outputs.compartment_id
operating_system = "Oracle Autonomous Linux"
operating_system_version = "8.7"
shape = "VM.Standard.E4.Flex"
state = "AVAILABLE"
sort_by = "TIMECREATED"
sort_order = "DESC"

filter {
name = "launch_mode"
values = ["NATIVE"]
}
}
This emulates all the values in our cluster
and this is the output
bastion_image_ids = {
"compartment_id" = "ocid1.compartment.oc1..aaaaaaaanydaqleheyo7hepeg6lsvplv7igvfarnomdigsk253h3mxkxjocq"
"display_name" = tostring(null)
"filter" = toset([
{
"name" = "launch_mode"
"regex" = false
"values" = tolist([
"NATIVE",
])
},
])
"id" = "CoreImagesDataSource-148668681"
"images" = tolist([])
"operating_system" = "Oracle Autonomous Linux"
"operating_system_version" = "8.7"
"shape" = "VM.Standard.E4.Flex"
"sort_by" = "TIMECREATED"
"sort_order" = "DESC"
"state" = "AVAILABLE"
}
as you can see... images field is an empty list. I had tried the same with 8.9 and it also returns an empty array for images.

I found the OCID for this image v8.9 (https://docs.oracle.com/en-us/iaas/images/image/a6afa61a-881a-4eee-acbd-e2267837275a/) and v8.7 (https://docs.oracle.com/en-us/iaas/images/image/d92c5776-cc18-472d-9f64-26dffa6bdd7d/). changed the bastion_image_type = "custom" and then applied, both 8.9 and 8.7 image ocids work. However, no images are found when I set bastion_image_type="platform"

Hi,

I can replicate the error. Can you please the image_type = customer and set the ocid for now until we've fixed it?

Hi,

in the operating system version, can you try setting only the major version "8" instead of also including the minor version?

The problem is the data resource query. We changed nothing and now cannot create new clusters. We do not set any custom bastion variables; just create_bastion = true

https://github.com/oracle-terraform-modules/terraform-oci-oke/blob/v5.1.5/module-bastion.tf#L5

Returns none and therefore fails.

A successful workaround for us is to define:

bastion_image_os_version = 8

Now the data resource works.

Thanks @hyder Please see customer update.

I just tried this out with the steps I listed. using data source oci_core_images to look up bastion images (Oracle Autonomous Linux 8.7). It is still not image to return any images.