Todos os produtos
Search
Central de documentação

Resource Orchestration Service:DATASOURCE::ECS::KeyPair

Última atualização: Jun 27, 2026

O recurso DATASOURCE::ECS::KeyPair consulta informações sobre um par de chaves.

Sintaxe

{
  "Type": "DATASOURCE::ECS::KeyPair",
  "Properties": {
    "KeyPairName": String,
    "RefreshOptions": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

KeyPairName

String

Sim

Sim

Nome do par de chaves.

Nenhuma.

RefreshOptions

String

Não

Sim

Política de atualização dos recursos da fonte de dados durante a atualização da pilha.

Valores válidos:

  • Never (padrão): não atualiza os recursos da fonte de dados ao atualizar a pilha.

  • Always: atualiza os recursos da fonte de dados ao atualizar a pilha.

Valores de retorno

Fn::GetAtt

  • KeyPairName: nome do par de chaves.

  • ResourceGroupId: ID do grupo de recursos.

  • CreateTime: hora de criação do par de chaves.

  • FingerPrint: impressão digital do par de chaves.

  • Tags: tags associadas ao par de chaves.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  KeyPairName:
    Type: String
    Description:
      en: |-
        The name of the key pair. You can use the asterisk (*) symbol as a wildcard in regular expressions to perform a fuzzy search for key pairs. Sample patterns:
        - *SshKey: queries key pairs whose names end with SshKey, including the key pair named SshKey.
        - SshKey*: queries key pairs whose names start with SshKey, including the key pair named SshKey.
        - *SshKey*: queries key pairs whose names include SshKey, including the key pair named SshKey.
        - SshKey: queries the key pair named SshKey.
    Required: true
    AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::ECS::KeyPair
    Properties:
      KeyPairName:
        Ref: KeyPairName
Outputs:
  KeyPairName:
    Description: The name of the key pair.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - KeyPairName
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroupId
  CreateTime:
    Description: The time when the key pair was created.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CreateTime
  FingerPrint:
    Description: The fingerprint of the key pair.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - FingerPrint
  Tags:
    Description: The tags of the key pair.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Tags
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "KeyPairName": {
      "Type": "String",
      "Description": {
        "en": "The name of the key pair. You can use the asterisk (*) symbol as a wildcard in regular expressions to perform a fuzzy search for key pairs. Sample patterns:\n- *SshKey: queries key pairs whose names end with SshKey, including the key pair named SshKey.\n- SshKey*: queries key pairs whose names start with SshKey, including the key pair named SshKey.\n- *SshKey*: queries key pairs whose names include SshKey, including the key pair named SshKey.\n- SshKey: queries the key pair named SshKey."
      },
      "Required": true,
      "AssociationProperty": "ALIYUN::ECS::KeyPair::KeyPairName"
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ECS::KeyPair",
      "Properties": {
        "KeyPairName": {
          "Ref": "KeyPairName"
        }
      }
    }
  },
  "Outputs": {
    "KeyPairName": {
      "Description": "The name of the key pair.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "KeyPairName"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroupId"
        ]
      }
    },
    "CreateTime": {
      "Description": "The time when the key pair was created.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "FingerPrint": {
      "Description": "The fingerprint of the key pair.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "FingerPrint"
        ]
      }
    },
    "Tags": {
      "Description": "The tags of the key pair.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Tags"
        ]
      }
    }
  }
}