ALIYUN::SAE::Secret类型用于创建命名空间中的Secret实例。
语法
{
"Type": "ALIYUN::SAE::Secret",
"Properties": {
"NamespaceId": String,
"SecretName": String,
"SecretType": String,
"SecretData": Map
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
NamespaceId | String | 是 | 否 | Secret 实例所在命名空间 ID。 | 如果所在命名空间为默认命名空间,则只需填写 RegionId,例如 |
SecretName | String | 是 | 否 | Secret 实例名称。 | 允许数字、字母和下划线(_)组合,仅允许以字母开头。 |
SecretType | String | 是 | 否 | 当前支持的 Secret 实例类型。 | 取值说明如下:
|
SecretData | Map | 是 | 是 | Secret 数据。 | Secret 键值对数据,为必填项。格式如下: {"Data":"{"k1":"v1", "k2":"v2"}"} k 表示键,v 表示值。 示例:
|
返回值
Fn::GetAtt
SecretId:Secret 实例 ID。
NamespaceId:Secret 实例所在命名空间 ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
SecretName:
Type: String
Description:
en: Secret instance name.Allows combinations of numbers, letters, en dash (-) and underscores (_) and only start with letters.
AllowedPattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
Required: true
SecretType:
Type: String
Description:
en: |-
The currently supported Secret instance type.The values are as follows:
kubernetes.io/dockerconfigjson: A confidential dictionary that stores the username and password of the mirror repository, used to pull mirror authentication during deployment.
AllowedValues:
- Opaque
- kubernetes.io/dockerconfigjson
- kubernetes.io/tls
Required: true
NamespaceId:
Type: String
Description:
en: The namespace ID where the Secret instance resides. If the namespace you are in is the default namespace, you just need to fill in the RegionId.
Required: true
SecretData:
Type: Json
Description:
en: |-
Secret key-value pair data, required.The format is as follows:
{"Data":"{"k1":"v1", "k2":"v2"}"}
k represents the key and v represents the value.
Required: true
Resources:
Secret:
Type: ALIYUN::SAE::Secret
Properties:
SecretName:
Ref: SecretName
SecretType:
Ref: SecretType
NamespaceId:
Ref: NamespaceId
SecretData:
Ref: SecretData
Outputs:
SecretId:
Description: The ID of the secret.
Value:
Fn::GetAtt:
- Secret
- SecretId
NamespaceId:
Description: The namespace ID that the Secret instance belongs to.
Value:
Fn::GetAtt:
- Secret
- NamespaceId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"SecretName": {
"Type": "String",
"Description": {
"en": "Secret instance name.Allows combinations of numbers, letters, en dash (-) and underscores (_) and only start with letters."
},
"AllowedPattern": "^[a-zA-Z][a-zA-Z0-9_-]*$",
"Required": true
},
"SecretType": {
"Type": "String",
"Description": {
"en": "The currently supported Secret instance type.The values are as follows:\nkubernetes.io/dockerconfigjson: A confidential dictionary that stores the username and password of the mirror repository, used to pull mirror authentication during deployment."
},
"AllowedValues": [
"Opaque",
"kubernetes.io/dockerconfigjson",
"kubernetes.io/tls"
],
"Required": true
},
"NamespaceId": {
"Type": "String",
"Description": {
"en": "The namespace ID where the Secret instance resides. If the namespace you are in is the default namespace, you just need to fill in the RegionId."
},
"Required": true
},
"SecretData": {
"Type": "Json",
"Description": {
"en": "Secret key-value pair data, required.The format is as follows:\n{\"Data\":\"{\"k1\":\"v1\", \"k2\":\"v2\"}\"}\nk represents the key and v represents the value."
},
"Required": true
}
},
"Resources": {
"Secret": {
"Type": "ALIYUN::SAE::Secret",
"Properties": {
"SecretName": {
"Ref": "SecretName"
},
"SecretType": {
"Ref": "SecretType"
},
"NamespaceId": {
"Ref": "NamespaceId"
},
"SecretData": {
"Ref": "SecretData"
}
}
}
},
"Outputs": {
"SecretId": {
"Description": "The ID of the secret.",
"Value": {
"Fn::GetAtt": [
"Secret",
"SecretId"
]
}
},
"NamespaceId": {
"Description": "The namespace ID that the Secret instance belongs to.",
"Value": {
"Fn::GetAtt": [
"Secret",
"NamespaceId"
]
}
}
}
}
该文章对您有帮助吗?