All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::KeyPairs

最終更新日:Oct 29, 2024

DATASOURCE::ECS::KeyPairs is used to query one or more key pairs.

Syntax

{
  "Type": "DATASOURCE::ECS::KeyPairs",
  "Properties": {
    "KeyPairFingerPrint": String,
    "KeyPairName": String,
    "ResourceGroupId": String,
    "Tags": List
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
KeyPairFingerPrintStringNoYesThe fingerprint of the key pair. The message-digest algorithm 5 (MD5) is used based on the public key fingerprint format defined in RFC 4716. For more information, see RFC4716.
KeyPairNameStringNoYesThe 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. Examples:
  • *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.
ResourceGroupIdStringNoYesThe ID of the resource group to which the key pair belongs. None.
TagsListNoYesThe tags of the key pair. You can specify up to 20 tags.

For more information, see Tags properties.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

PropertyTypeRequiredEditableDescriptionConstraint
ValueStringNoNoThe tag value of the key pair. The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.
KeyStringYesNoThe tag key of the key pair. The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

Return values (Fn::GetAtt)

  • KeyPairNames: the names of the key pairs.
  • KeyPairs: details of the key pairs.
PropertyTypeDescriptionConstraint
KeyPairNamesListThe names of the key pairs. None.
KeyPairsListDetails of the key pairs. None.
KeyPairNameStringThe names of the key pairs. Sample name: testKeyPairName.
KeyPairFingerPrintStringThe fingerprint of the key pair. Sample fingerprint: ABC1234567.
ResourceGroupIdStringThe ID of the resource group. Sample ID: rg-amnhr7u7c7hj****.
TagsListThe tags of the key pair. None.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "KeyPairName": {
      "Type": "String",
      "Description": "he name of the key pair. You can use the asterisk (*) symbol as a wildcard in regular expressions to query key pairs by performing a fuzzy search. Sample patterns:\n*SshKey: queries key pairs whose names end with SshKey, including the key pair named SshKey.\nSshKey*: 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.\nSshKey: queries the key pair named SshKey."
    }
  },
  "Resources": {
    "KeyPairs": {
      "Type": "DATASOURCE::ECS::KeyPairs",
      "Properties": {
        "KeyPairName": {
          "Ref": "KeyPairName"
        }
      }
    }
  },
  "Outputs": {
    "KeyPairs": {
      "Value": {
        "Fn::GetAtt": [
          "KeyPairs",
          "KeyPairs"
        ]
      }
    },
    "KeyPairNames": {
      "Value": {
        "Fn::GetAtt": [
          "KeyPairs",
          "KeyPairNames"
        ]
      }
    }
  }
}