From ad68fcf9b8eaa9fe12281dcbd3746f731ab87fa6 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Tue, 15 Jul 2014 12:22:32 +0100 Subject: [PATCH] Add very simple ResourceGroup example Adds a trivial example demonstrating how the attributes of the nested resources may be accessed via the "synthetic attributes" mentioned in the docs. Change-Id: Iea08bd5f362a94552d6e94c8461f9809cf8d33a7 --- hot/resource_group.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 hot/resource_group.yaml diff --git a/hot/resource_group.yaml b/hot/resource_group.yaml new file mode 100644 index 00000000..a644a679 --- /dev/null +++ b/hot/resource_group.yaml @@ -0,0 +1,24 @@ +heat_template_version: 2013-05-23 + +resources: + random_group: + type: OS::Heat::ResourceGroup + properties: + count: 2 + resource_def: + type: OS::Heat::RandomString + +outputs: + # Note for RandomString the resource ID is set to the random string + # value, for other resources the ID returned will be the uuid of the + # actual resource + resource1_id: + value: {get_attr: [random_group, resource.0]} + resource2_id: + value: {get_attr: [random_group, resource.1]} + # The last part of the resource.0.value specifies the attribute of the + # nested resource to access, e.g in this case 'value' + resource1_value: + value: {get_attr: [random_group, resource.0.value]} + resource2_value: + value: {get_attr: [random_group, resource.1.value]}