Resource Group Index

Registered by Kevin Fox

Resource groups need a psudo param that allows the nested/iterated templates to know their position.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Steve Baker

Related branches

Sprints

Whiteboard

For example, consider the following psudocode:
"Parameters": {
    "BaseIp": {
        Default: "10.0.101."
   }
   "Ip0": {
        Default: "10"
  }
   "Ip1": {
        Default: "11"
  }
   "Ip2": {
        Default: "12"
  }
}
"Resources": {
  "0": {
    "Properties": {
       "Ip": { "Join": [ "", [ {"Ref": "BaseIP"}, {"Ref": "Ip0"}] }
        ...
     }
  },
  "1": {
    "Properties": {
       "Ip": { "Join": [ "", [ {"Ref": "BaseIP"}, {"Ref": "Ip1"}] }
        ...
     }
  },
  "2": {
    "Properties": {
       "Ip": { "Join": [ "", [ {"Ref": "BaseIP"}, {"Ref": "Ip2"}] }
        ...
     }
  }
}

With a Resource Group and a psudo param, you should be able to do something like:
"Resources": {
  "configcluster": {
    "type": "OS::Heat::ResourceGroup",
      "properties": {
        "count": 3,
          "Properties": {
             "name": { "Join":["", [ "configsvr-", {"Ref": "OS::ResourceGroupIdx"}]},
             "Ip": { "Join": [ "", [
                   {"Ref": "BaseIP"},
                     {"Ref": {
                         "Join": ["" [
                             "Ip",
                             {"Ref": "OS::ResourceGroupIdx"}
                        ]
                     }}
              }] }
        ...
     }
  }

-----------------------------------------------
There seems to be a duplicate blueprint now:
https://blueprints.launchpad.net/heat/+spec/override-resource-name-in-resource-group

Addressed by:
https://review.openstack.org/#/c/88636/

That seems to solve this.

s/{"Ref": "OS::ResourceGroupIdx"}/"%index%"/ in the above examples, or even merge it into the other string and drop the join.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.