Retrieving attributes from a resource group with a tempate composition

Viewed 8

I want to create multiple copies of some resources defined in a template. How do I retrieve the attributes of the resources created in this fashion.

To illustrate, here is a template to create a random string (I call word.yaml):

heat_template_version: rocky

resources:
  word:
    type: OS::Heat::RandomString

Because I want a list of such random strings, I use an OS::Heat::ResourceGroup calling the template from word.yaml:

heat_template_version: rocky

resources:
  composition:
    type: OS::Heat::ResourceGroup
    properties:
      count: 2
      resource_def:
        type: word.yaml

outputs:
  composition:
    value: {get_attr: [composition, resource.word]}

Rubbing together the explanation of OS::Heat::ResourceGroup (ResourceGroup) and the template composition documentation (nested attributes), I expected a list of strings in my output, yet I get:

{
  "outputs": [
    {
      "output_key": "composition",
      "description": "No description given",
      "output_error": "Member 'word' not found in group resource 'composition'.",
      "output_value": null
    }
  ]
}

What am I missing about the interaction of the resource group and the template composition?

0 Answers
Related