Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400-InvalidParameter, Invalid sourceDetails.imageId: null (Image ID must not be null) when use instance_source_image_filter_details #2102

Open
ngochieu642 opened this issue May 1, 2024 · 0 comments
Labels

Comments

@ngochieu642
Copy link

Terraform Version and Provider Version

$ terraform --version
Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/oracle/oci v5.38.0

Affected Resource(s)

"oci_core_instance"

Terraform Configuration Files

resource "oci_core_instance" "my_vm" {
  availability_domain = local.ad
  compartment_id      = local.compartment_id
  shape               = var.vm_shape["shape"]

  shape_config {
    ocpus         = var.vm_shape["ocpus"]
    memory_in_gbs = var.vm_shape["memory"]
  }

  source_details {
    source_type             = "image"
    boot_volume_size_in_gbs = var.vm_shape["boot_volume_size"]
    instance_source_image_filter_details {
      compartment_id = var.tenancy_ocid
      operating_system = "Oracle Linux"
      operating_system_version = "7.9"
    }
  }

  create_vnic_details {
    assign_public_ip = false
    subnet_id        = oci_core_subnet.my_private_subnet.id
  }

  metadata = {
    ssh_authorized_keys = join("\n", local.authorized_keys)
  }
}
# 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

  • This is at API level error so no related output

Panic Output

  • None

Expected Behavior

  • Find the image and run that

Actual Behavior

  • Complain about imageId is null
module.sam_3TB.oci_core_instance.my_vm: Creating...
╷
│ Error: 400-InvalidParameter, Invalid sourceDetails.imageId: null (Image ID must not be null)
│ Suggestion: Please update the parameter(s) in the Terraform config as per error message Invalid sourceDetails.imageId: null (Image ID must not be null)
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_instance 
│ API Reference: https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Instance/LaunchInstance 
│ Request Target: POST https://iaas.uk-london-1.oraclecloud.com/20160918/instances 
│ Provider version: 5.38.0, released on 2024-04-21. This provider is 1 Update(s) behind to current. 
│ Service: Core Instance 
│ Operation Name: LaunchInstance 
│ OPC request ID: 61f08045905fccdb9ba1c3bac04fdc94/F40152A95F50BC3D19306AC79FAECA42/88198490B1893DE871377C6345194098 
│ 
│ 
│   with module.sam_3TB.oci_core_instance.my_vm,
│   on sam_3TB/compute.tf line 202, in resource "oci_core_instance" "my_vm":
│  202: resource "oci_core_instance" "my_vm" {
│ 

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@ngochieu642 ngochieu642 added the bug label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant