Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Terraform | CLC provider | Get name of a clc_group searching with ID. #1

Open
hashibot opened this issue Jun 13, 2017 · 0 comments
Open
Labels

Comments

@hashibot
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant