All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DEVOPS::VariableGroup

Last Updated:Nov 17, 2023

ALIYUN::DEVOPS::VariableGroup is used to create a variable group.

Syntax

{
  "Type": "ALIYUN::DEVOPS::VariableGroup",
  "Properties": {
    "Variables": List,
    "Description": String,
    "OrganizationId": String,
    "Name": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Variables

List

Yes

Yes

The variables in JSON format.

A JSON string consists of the isEncrypted, name, and value fields. The name field specifies the variable name and the value field specifies the variable value. Example:

[{"isEncrypted":true,"name":"name1","value":"vaue1"}]

For more information, see Variables properties.

Description

String

No

Yes

The description of the variable group.

None.

OrganizationId

String

Yes

No

The enterprise ID.

The enterprise ID is of the String type. You can obtain the enterprise ID by accessing the Apsara DevOps endpoint. Example:

https://devops.aliyun.com/organization/[OrganizationId]

Name

String

Yes

Yes

The name of the variable group.

None.

Variables syntax

"Variables": [
  {
    "isEncrypted": Boolean,
    "name": String,
    "value": String
  }
]

Variables properties

Property

Type

Required

Editable

Description

Constraint

isEncrypted

Boolean

Yes

No

Specifies whether to encrypt the variable group.

Valid values:

  • true

  • false

name

String

Yes

No

The variable name.

None.

value

String

Yes

No

The variable value.

None.

Return values

Fn::GetAtt

VariableGroupId: the ID of the variable group.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Name:
        Description:
          en: The name of variable group.
        Type: String
      OrganizationId:
        Description:
          en: Corporate identity, also known as enterprise id, can obtain in cloud effect access links.
        Type: String
        Default: 5ebbc0228123212b59xxxxx
      Variables:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            AssociationPropertyMetadata:
              Parameters:
                isEncrypted:
                  Description:
                    en: Encryption or not.
                  Type: Boolean
                name:
                  Description:
                    en: Name of the variable.
                  Type: String
                value:
                  Description:
                    en: Value of the variable.
                  Type: String
            Type: Json
        Description:
          en: Variables information.
        Type: Json
        Default:
          - isEncrypted: true
            name: name1
            value: vaue1
    Resources:
      VariableGroup:
        Properties:
          Name:
            Ref: Name
          OrganizationId:
            Ref: OrganizationId
          Variables:
            Ref: Variables
        Type: ALIYUN::DEVOPS::VariableGroup
    Outputs:
      VariableGroupId:
        Description: Variable group id.
        Value:
          Fn::GetAtt:
            - VariableGroup
            - VariableGroupId
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Name": {
          "Description": {
            "en": "The name of variable group."
          },
          "Type": "String"
        },
        "OrganizationId": {
          "Description": {
            "en": "Corporate identity, also known as enterprise id, can obtain in cloud effect access links."
          },
          "Type": "String",
          "Default": "5ebbc0228123212b59xxxxx"
        },
        "Variables": {
          "AssociationProperty": "List[Parameter]",
          "AssociationPropertyMetadata": {
            "Parameter": {
              "AssociationPropertyMetadata": {
                "Parameters": {
                  "isEncrypted": {
                    "Description": {
                      "en": "Encryption or not."
                    },
                    "Type": "Boolean"
                  },
                  "name": {
                    "Description": {
                      "en": "Name of the variable."
                    },
                    "Type": "String"
                  },
                  "value": {
                    "Description": {
                      "en": "Value of the variable."
                    },
                    "Type": "String"
                  }
                }
              },
              "Type": "Json"
            }
          },
          "Description": {
            "en": "Variables information."
          },
          "Type": "Json",
          "Default": [
            {
              "isEncrypted": true,
              "name": "name1",
              "value": "vaue1"
            }
          ]
        }
      },
      "Resources": {
        "VariableGroup": {
          "Properties": {
            "Name": {
              "Ref": "Name"
            },
            "OrganizationId": {
              "Ref": "OrganizationId"
            },
            "Variables": {
              "Ref": "Variables"
            }
          },
          "Type": "ALIYUN::DEVOPS::VariableGroup"
        }
      },
      "Outputs": {
        "VariableGroupId": {
          "Description": "Variable group id.",
          "Value": {
            "Fn::GetAtt": [
              "VariableGroup",
              "VariableGroupId"
            ]
          }
        }
      }
    }