Coder Social home page Coder Social logo

Resource 'data.baremetal_core_vnic_attachments.master_node_vnics' does not have attribute 'vnic_attachments.0.vnic_id' about terraform-provider-oci HOT 5 CLOSED

oracle avatar oracle commented on June 1, 2024
Resource 'data.baremetal_core_vnic_attachments.master_node_vnics' does not have attribute 'vnic_attachments.0.vnic_id'

from terraform-provider-oci.

Comments (5)

craigcarl-oracle avatar craigcarl-oracle commented on June 1, 2024

@scross01 I pushed a new binary yesterday designed to fixed this issue, are you using the newest version?

from terraform-provider-oci.

scross01 avatar scross01 commented on June 1, 2024

I tested with the latest build (v1.0.3)

The problem only seems to occur when using the count parameter for launching multiple instances. I wonder if it could be a core problem with the ${element()} function because there are two indexed items in the data item reference - although it's odd that it works okay on a second apply.

from terraform-provider-oci.

lfeldman avatar lfeldman commented on June 1, 2024

I am not sure if you have noticed but I think it works different when you try to obtain vnics info for VMs and BMs. For BMs works perfectly fine. For VMs it looks like there is no vnic at all... But I am still wondering how to posses for further purposes VM's public IP address...

from terraform-provider-oci.

andrey-dubnik avatar andrey-dubnik commented on June 1, 2024

Having the same issue while using count. When TF apply starts it throws errors

* data.baremetal_core_vnic.InstanceVnic[0]: Resource 'data.baremetal_core_vnic_attachments.InstanceVnics' does not have attribute 'vnic_attachments.0.vnic_id' for variable 'data.baremetal_core_vnic_attachments.InstanceVnics.*.vnic_attachments.0.vnic_id'
* data.baremetal_core_vnic.InstanceVnic[1]: Resource 'data.baremetal_core_vnic_attachments.InstanceVnics' does not have attribute 'vnic_attachments.0.vnic_id' for variable 'data.baremetal_core_vnic_attachments.InstanceVnics.*.vnic_attachments.0.vnic_id'

Where code look like this

# Gets a list of vNIC attachments on the instance
data "baremetal_core_vnic_attachments" "InstanceVnics" { 
    count = "${var.machine_count}"
    compartment_id = "${var.compartment_ocid}" 
    availability_domain = "${lookup(data.baremetal_identity_availability_domains.ADs.availability_domains[var.AD - 1],"name")}" 
    instance_id = "${element(baremetal_core_instance.TFInstance.*.id,count.index)}" 
}  

data "baremetal_core_vnic" "InstanceVnic" { 
    depends_on = ["baremetal_core_instance.TFInstance"]
    count = "${var.machine_count}"
    vnic_id = "${data.baremetal_core_vnic_attachments.InstanceVnics.*.vnic_attachments.0.vnic_id[count.index]}"
}

If I comment the problem and provision configuration and then uncomment the code it works just fine. Seem TF does check ahead of time when tfstate is formed.

from terraform-provider-oci.

codycushing avatar codycushing commented on June 1, 2024

baremetal_core_instance...public_ip|private_ip will be available in v1.0.10, no longer requiring explicit vnic lookup.

from terraform-provider-oci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.