Updated on 2022-02-22 GMT+08:00

get_reference

The get_reference function is the simplified form of the get_attribute function. When the attribute information ends with id or name, use the get_attribute (refID or refName) function.

Syntax

get_reference: [elementName ]

Parameters

Table 1 Parameters

Parameter

Mandatory

Description

elementName

Yes

Element name defined in the node_templates section of the blueprint file.

Return Value

Value of the parameter

Examples

The following describes how to use the get_reference function to obtain the dynamic attributes of associated elements:

node_templates: 
  my-first-vpc: 
    type: Cloud.VPC.VPC 
    properties: 
      name: {get_input: name} 
      ciddr: {get_input: cidr}
  my-first-subnet: 
    type: Cloud.VPC.VPC 
    properties: 
      vpcId: {get_reference: my-first-vpc } # Corresponding to {get_attribute: [my-first-vpc, refID] }
      ...