Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::SAE::Secret

Última atualização: Jun 27, 2026

Cria uma instância de Secret em um namespace.

Sintaxe

{
  "Type": "ALIYUN::SAE::Secret",
  "Properties": {
    "NamespaceId": String,
    "SecretName": String,
    "SecretType": String,
    "SecretData": Map
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

NamespaceId

String

Sim

Não

ID do namespace da instância de Secret.

Para o namespace padrão, especifique apenas o RegionId, como cn-beijing.

SecretName

String

Sim

Não

Nome da instância de Secret.

O valor pode conter letras, dígitos e sublinhados (_) e deve começar com uma letra.

SecretType

String

Sim

Não

Tipo da instância de Secret.

Valores válidos:

  • kubernetes.io/dockerconfigjson: dicionário de segredos que armazena o nome de usuário e a senha do repositório de imagens para autenticação durante o pull de imagens na implantação.

SecretData

Map

Sim

Sim

Dados do Secret.

Especifique os dados de chave-valor no seguinte formato:

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

Neste formato, k representa a chave e v representa o valor.

Exemplo de valor:

{
  ".dockerconfigjson": "eyJhdXRocyI6eyJyZWdpc3RyeS12cGMuY24tYmVpamluZy5hbGl5dW5jcy5jb20iOnsidXNlcm5hbWUiOiJ1c2VybmFtZSIsInBhc3N3b3JkIjoicGFzc3dvcmQiLCJhdXRoIjoiZFhObGNtNWhiV1U2Y0dGemMzZHZjbVE9In0sInJlZ2lzdHJ5LmNuLWJlaWppbmcuYWxpeXVuY3MuY29tIjp7InVzZXJuYW1lIjoidXNlcm5hbWUiLCJwYXNzd29yZCI6InBhc3N3b3JkIiwiYXV0aCI6ImRYTmxjbTVoYldVNmNHRnpjM2R2Y21RPSJ9fX0="
}

Valores de retorno

Fn::GetAtt

  • SecretId: ID da instância de Secret.

  • NamespaceId: ID do namespace da instância de Secret.

Exemplo

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