全部产品
Search
文档中心

资源编排:ALIYUN::SAE::ConfigMap

更新时间:Sep 02, 2024

ALIYUN::SAE::ConfigMap类型用于创建命名空间中的ConfigMap实例。

语法

{
  "Type": "ALIYUN::SAE::ConfigMap",
  "Properties": {
    "Data": Map,
    "NamespaceId": String,
    "Name": String,
    "Description": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Data

Map

ConfigMap 数据。

ConfigMap 键值对数据,JSON 格式。格式如下:

{"Data":"{"k1":"v1", "k2":"v2"}"}

k表示键,v表示值。关于配置项的更多信息,请参见管理和使用配置项(K8s ConfigMap)

NamespaceId

String

ConfigMap 实例所在命名空间 ID。

Name

String

ConfigMap 实例名称。

允许数字、字母和下划线(_)组合,仅允许以字母开头。

Description

String

描述信息。

不可输入空格,且不超过 255 个字符。

返回值

Fn::GetAtt

  • ConfigMapId:ConfigMap 实例 ID。

  • NamespaceId:ConfigMap 实例所在命名空间 ID。

示例

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Data": {
      "Type": "Json",
      "Description": {
        "en": "Configmap key value pairs of data, json format.The format is as follows:\n{\"k1\":\"v1\", \"k2\":\"v2\"}\nK means key, V represents value.For more information about configuration items, see management and use of configuration items."
      },
      "Required": true
    },
    "NamespaceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the namespace to which this config map instance belongs."
      },
      "Required": true
    },
    "Name": {
      "Type": "String",
      "Description": {
        "en": "The name of the config map."
      },
      "Required": true
    }
  },
  "Resources": {
    "ConfigMap": {
      "Type": "ALIYUN::SAE::ConfigMap",
      "Properties": {
        "Data": {
          "Ref": "Data"
        },
        "NamespaceId": {
          "Ref": "NamespaceId"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "ConfigMapId": {
      "Description": "The ID of the config map.",
      "Value": {
        "Fn::GetAtt": [
          "ConfigMap",
          "ConfigMapId"
        ]
      }
    },
    "NamespaceId": {
      "Description": "The ID of the namespace to which this config map instance belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ConfigMap",
          "NamespaceId"
        ]
      }
    }
  }
}
                        
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Data": {
      "Type": "Json",
      "Description": {
        "en": "Configmap key value pairs of data, json format.The format is as follows:\n{\"k1\":\"v1\", \"k2\":\"v2\"}\nK means key, V represents value.For more information about configuration items, see management and use of configuration items."
      },
      "Required": true
    },
    "NamespaceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the namespace to which this config map instance belongs."
      },
      "Required": true
    },
    "Name": {
      "Type": "String",
      "Description": {
        "en": "The name of the config map."
      },
      "Required": true
    }
  },
  "Resources": {
    "ConfigMap": {
      "Type": "ALIYUN::SAE::ConfigMap",
      "Properties": {
        "Data": {
          "Ref": "Data"
        },
        "NamespaceId": {
          "Ref": "NamespaceId"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "ConfigMapId": {
      "Description": "The ID of the config map.",
      "Value": {
        "Fn::GetAtt": [
          "ConfigMap",
          "ConfigMapId"
        ]
      }
    },
    "NamespaceId": {
      "Description": "The ID of the namespace to which this config map instance belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ConfigMap",
          "NamespaceId"
        ]
      }
    }
  }
}