DATASOURCE::KMS::Secret类型用于查询某个凭据详情。
语法
{
  "Type": "DATASOURCE::KMS::Secret",
  "Properties": {
    "SecretName": String,
    "RefreshOptions": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| SecretName | String | 是 | 是 | 凭据名称。 | 无 | 
| RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值: 
 | 
返回值
Fn::GetAtt
- Description:凭据描述。 
- RotationInterval:凭据自动轮转的周期。 
- LastRotationDate:最近一次轮转的时间。 
- SecretType:凭据类型。 
- CreateTime:创建凭据的时间。 
- DKMSInstanceId:KMS实例的实例ID。 
- AutomaticRotation:是否开启自动轮转。 
- SecretName:凭据名称。 
- NextRotationDate:下一次轮转的时间。 
- UpdateTime:凭据的更新时间。 
- PlannedDeleteTime:计划删除时间。 
- ExtendedConfig:凭据的拓展配置。 
- Arn:凭据的资源名称(ARN)。 
- EncryptionKeyId:加密凭据值的KMS密钥的标识符。 
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SecretName:
    Type: String
    Description:
      en: The name of the secret.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::KMS::Secret
    Properties:
      SecretName:
        Ref: SecretName
Outputs:
  Description:
    Description: The description of the secret.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Description
  RotationInterval:
    Description: 'The interval for automatic rotation. The value is in the integer[unit] format. integer indicates the length of time. unit: indicates the time unit. The value of unit is fixed as s. For example, if the value is 604800s, automatic rotation is performed at a 7-day interval.The value is in the integer[unit] format. integer indicates the length of time. unit: indicates the time unit. The value of unit is fixed as s. For example, if the value is 604800s, automatic rotation is performed at a 7-day interval.'
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - RotationInterval
  LastRotationDate:
    Description: The time when the last rotation was performed.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - LastRotationDate
  SecretType:
    Description: 'The type of the secret. '
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - SecretType
  CreateTime:
    Description: The time when the secret was created.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CreateTime
  DKMSInstanceId:
    Description: The ID of the dedicated KMS instance.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - DKMSInstanceId
  AutomaticRotation:
    Description: 'Indicates whether automatic rotation is enabled. '
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - AutomaticRotation
  SecretName:
    Description: The name of the secret.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - SecretName
  NextRotationDate:
    Description: The time when the next rotation will be performed.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - NextRotationDate
  UpdateTime:
    Description: The time when the secret was updated.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - UpdateTime
  PlannedDeleteTime:
    Description: The time when the secret is scheduled to be deleted.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - PlannedDeleteTime
  ExtendedConfig:
    Description: The extended configuration of the secret.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ExtendedConfig
  Arn:
    Description: The Alibaba Cloud Resource Name (ARN) of the secret.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Arn
  EncryptionKeyId:
    Description: The ID of the customer master key (CMK) that is used to encrypt the secret value.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - EncryptionKeyId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SecretName": {
      "Type": "String",
      "Description": {
        "en": "The name of the secret."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::KMS::Secret",
      "Properties": {
        "SecretName": {
          "Ref": "SecretName"
        }
      }
    }
  },
  "Outputs": {
    "Description": {
      "Description": "The description of the secret.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Description"
        ]
      }
    },
    "RotationInterval": {
      "Description": "The interval for automatic rotation. The value is in the integer[unit] format. integer indicates the length of time. unit: indicates the time unit. The value of unit is fixed as s. For example, if the value is 604800s, automatic rotation is performed at a 7-day interval.The value is in the integer[unit] format. integer indicates the length of time. unit: indicates the time unit. The value of unit is fixed as s. For example, if the value is 604800s, automatic rotation is performed at a 7-day interval.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "RotationInterval"
        ]
      }
    },
    "LastRotationDate": {
      "Description": "The time when the last rotation was performed.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "LastRotationDate"
        ]
      }
    },
    "SecretType": {
      "Description": "The type of the secret. ",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SecretType"
        ]
      }
    },
    "CreateTime": {
      "Description": "The time when the secret was created.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "DKMSInstanceId": {
      "Description": "The ID of the dedicated KMS instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "DKMSInstanceId"
        ]
      }
    },
    "AutomaticRotation": {
      "Description": "Indicates whether automatic rotation is enabled. ",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "AutomaticRotation"
        ]
      }
    },
    "SecretName": {
      "Description": "The name of the secret.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SecretName"
        ]
      }
    },
    "NextRotationDate": {
      "Description": "The time when the next rotation will be performed.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "NextRotationDate"
        ]
      }
    },
    "UpdateTime": {
      "Description": "The time when the secret was updated.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "UpdateTime"
        ]
      }
    },
    "PlannedDeleteTime": {
      "Description": "The time when the secret is scheduled to be deleted.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PlannedDeleteTime"
        ]
      }
    },
    "ExtendedConfig": {
      "Description": "The extended configuration of the secret.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ExtendedConfig"
        ]
      }
    },
    "Arn": {
      "Description": "The Alibaba Cloud Resource Name (ARN) of the secret.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Arn"
        ]
      }
    },
    "EncryptionKeyId": {
      "Description": "The ID of the customer master key (CMK) that is used to encrypt the secret value.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "EncryptionKeyId"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?