You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.
Hi
i'm new to terraform, and i'm about to become mad to understand how to achieve my scope :)
let me explain you the scenario.
I'm using terraform version v0.7.3 using the CLC provider (Centurylink cloud).
i've declared a variable file with all the group folder that i need:
variable "VTYPEFOLDER" { type = "map" description = "Folder that contain the VM" default = { GlobParent = "Mainfolder" GlobFolder1 = "SubFolder1" GlobFolder2 = "SubFolder2" GlobFolder3 = "SubFolder3" } }
Then, i've created all the resource on cloud in a "loop" using the word 'count' and getting the name using the count.index to retreive the folder name.
Now, i'm about to create the VM, that require the group_id value, that is only reliable using the statement clc_group.RAPPTYPEAVS.*.id.
But how can i get the id based on folder name within this resource "clc_group"?
This is an example of what i want to do (sorry for using a 'sql' example, but is the best way to explain what i want to do):
... group_id = select clc_group.folder.id where clc_group.folder.name = "Subfolder1"
...
Please let me know if there is some feature that can help me.
thanks,
s.
The text was updated successfully, but these errors were encountered:
This issue was originally opened by @sgreco2002 as hashicorp/terraform#9014. It was migrated here as part of the provider split. The original body of the issue is below.
Hi
i'm new to terraform, and i'm about to become mad to understand how to achieve my scope :)
let me explain you the scenario.
I'm using terraform version v0.7.3 using the CLC provider (Centurylink cloud).
i've declared a variable file with all the group folder that i need:
variable "VTYPEFOLDER" {
type = "map"
description = "Folder that contain the VM"
default = {
GlobParent = "Mainfolder"
GlobFolder1 = "SubFolder1"
GlobFolder2 = "SubFolder2"
GlobFolder3 = "SubFolder3"
}
}
Then, i've created all the resource on cloud in a "loop" using the word 'count' and getting the name using the count.index to retreive the folder name.
resource "clc_group" "RAPPTYPEAVS" {
count = "${length(var.VTYPEFOLDER)}"
location_id = "${var.VAPPFOLDER.["GlobLocationID"]}"
parent = "${var.VTYPEFOLDER.["GlobParent"]}"
name = "${element (values(var.VTYPEFOLDER), count.index)}"
}
Now, i'm about to create the VM, that require the group_id value, that is only reliable using the statement
clc_group.RAPPTYPEAVS.*.id.
But how can i get the id based on folder name within this resource "clc_group"?
This is an example of what i want to do (sorry for using a 'sql' example, but is the best way to explain what i want to do):
...
group_id = select clc_group.folder.id where clc_group.folder.name = "Subfolder1"
...
Please let me know if there is some feature that can help me.
thanks,
s.
The text was updated successfully, but these errors were encountered: