1
votes

#getting below error while running "terraform plan". i am trying to create three windows compute resources. the instance_name are of list type and a count is added to resource

Error: Incorrect attribute value type

on datasource.tf line 7, in data "oci_core_instance_credentials" "instance_credentials": 7: instance_id = ["${oci_core_instance.jde_instance.*.id}"]

Inappropriate value for attribute "instance_id": string required.

1

1 Answers

0
votes

oci_core_instance_credentials requires just one value. But you are passing an array.

It should be as below assuming that oci_core_instance.jde_instance is an array. This way you are using first instance in the array:

instance_id = oci_core_instance.jde_instance[0].id

If its a single array it should be:

instance_id = oci_core_instance.jde_instance.id