全部产品
Search
文档中心

资源编排:ALIYUN::DEVOPS::VariableGroup

更新时间:Aug 12, 2024

ALIYUN::DEVOPS::VariableGroup类型用于创建变量组。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

Variables

List

变量信息JSON字符串。

isEncrypted标识,name表示变量名称 ,value表示变量值。示例如下:

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

更多信息,请参见Variables属性

Description

String

变量组描述。

OrganizationId

String

企业标识,也称企业ID。

字符串形式。您可以在云效访问链接中获取该参数取值。示例如下:

https://devops.aliyun.com/organization/【OrganizationId】

Name

String

变量组名称。

Variables语法

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

Variables属性

属性名称

类型

必须

允许更新

描述

约束

isEncrypted

Boolean

是否加密。

取值:

  • true:加密。

  • false:不加密。

name

String

变量名称。

value

String

变量值。

返回值

Fn::GetAtt

VariableGroupId:新建的变量组ID

示例

  • YAML格式

    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格式

    {
      "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"
            ]
          }
        }
      }
    }