How do i get IDs of the nested resources in ResourceGroup ?

asked 2019-11-22 10:29:06 -0500

Cheos96 gravatar image

Hi everyone, using the attribute refs in ResourceGroup doesn't solve me the problem, how do i do ?

my example is: i created a group of ports with resource group and below i wanted to attach these ports with servers i just created, so in parameter of resource group of server, i need a list of IDs of the port i created. Using refs doesn't give me the id of the ports but the id of the resource group :s

Thanks for your help.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-11-25 10:13:21 -0500

zaneb gravatar image

{get_resource: my_resgroup} gets the ID of the resource group; {get_attr: [my_resgroup, refs]} gets a list of IDs of the ports (resources within the resource group).

edit flag offensive delete link more


Hi Zaneb, Thanks you very much for your answers. I found a solution for this problem. In the nested template, i added an output section: port_id: value: get_resource: group_port and in my original template i just did a get_attr: - grp_port - port_id

Cheos96 gravatar imageCheos96 ( 2019-11-25 17:05:05 -0500 )edit

Oh, so the scaled unit in your ResourceGroup is also a stack, not just a Port? You found the right solution then.

zaneb gravatar imagezaneb ( 2019-11-26 22:22:19 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2019-11-22 10:29:06 -0500

Seen: 140 times

Last updated: Nov 25 '19