DATASOURCE::ECS::KeyPair

DATASOURCE::ECS::KeyPair类型用于查询一个密钥对详情。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

KeyPairName

String

密钥对名称。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

  • KeyPairName:密钥对名称。

  • ResourceGroupId:资源组ID。

  • CreateTime:密钥对创建时间。

  • FingerPrint:密钥对的指纹。

  • 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:
        - *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"
        ]
      }
    }
  }
}