All Products
Search
Document Center

:Parameter reference in scripts

Last Updated:Jun 20, 2026

When you create a file-based or script-based deployment package, you can pass configuration parameters from a service instance to your commands or scripts.

Background information

After you deploy a service instance, Compute Nest stores its input and output parameters in the parameter warehouse of Operation Orchestration Service (OOS). This allows you to view, manage, and reference these parameters in your scripts. For more information about the parameter warehouse, see Parameters.

Parameter reference syntax

When creating a file-based or script-based deployment package, you can reference parameters from the service instance by using the {{ xxx }} syntax in the command content field. Compute Nest automatically identifies the placeholder within {{ xxx }} and replaces it with the parameter's value.

  • To reference an input parameter, use the format {{ parameters_xxx }}. Here, xxx represents the name of the input parameter defined in the template.

  • To reference an output parameter, use the format {{ outputs_xxx }}. Here, xxx represents the name of the output parameter defined in the template.

Example

ROS template

The following code shows a sample Resource Orchestration Service (ROS) template used when creating a service.

{
  "ROSTemplateFormatVersion": "2015-09-01", 
  "Description": {
    "en": "This template supports single-instance with custom image, including scenarios using existing and creating ECS by prepaid or postpaid model"
  },
  "Parameters": {
    "VpcId": {
      "Default": null,
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "Please select the existing VPC. <br><b><font color='blue'>If you can't find the VPC, please switch regions.</font></b>"
      },
      "Label": {
        "en": "Existing VPC ID"
      }
    }
........
  },
  "Outputs": {
    "InstanceIds": {
      "Value": {
        "Fn::GetAtt": [
          "ECSInstances",
          "InstanceIds"
        ]
      }
    }
  }
........
}

Reference parameters in a script

When you create a deployment package, you enter commands to reference the values of the VpcId and InstanceIds parameters from the service instance.

Set the Deployment package download directory to /root, select Linux Shell for the Command type, and enter the following in the command content field:

echo {{parameters_VpcId}}
echo {{outputs_InstanceIds}}

Compute Nest automatically replaces {{parameters_VpcId}} and {{outputs_InstanceIds}} with the actual values from the service instance. For example, if the VpcId is vpc-bp19b73artdf07gmkxxxx and InstanceIds is i-bp1b7gbbybdnvafuxxx, Compute Nest replaces the placeholders with these values when the script runs.

The script then effectively runs the following commands:

echo vpc-bp19b73artdf07gmkxxxx
echo [ "i-bp1b7gbbybdnvafuxxx"]