DATASOURCE::RAM::Role

DATASOURCE::RAM::Role类型用于获取单个角色信息。

语法

{
  "Type": "DATASOURCE::RAM::Role",
  "Properties": {
    "RoleName": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

RoleName

String

指定角色名。

RefreshOptions

String

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

有效值:

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

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

返回值

Fn::GetAtt

  • MaxSessionDuration:角色最大会话时间。

  • UpdateDate:更新时间。

  • RoleName:角色名称。

  • Description:角色描述。

  • Arn:角色的资源描述符。

  • RoleId:角色 ID。

  • CreateDate:创建时间。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RoleName:
    Type: String
    Description:
      en: RAM role name. If not specified, the current ram role will be used.
    Required: false
    AssociationProperty: ALIYUN::RAM::Role
Resources:
  Role:
    Type: DATASOURCE::RAM::Role
    Properties:
      RoleName:
        Ref: RoleName
Outputs:
  MaxSessionDuration:
    Description: The maximum session duration of the RAM role.
    Value:
      Fn::GetAtt:
        - Role
        - MaxSessionDuration
  UpdateDate:
    Description: The time when the RAM role was last updated.
    Value:
      Fn::GetAtt:
        - Role
        - UpdateDate
  RoleName:
    Description: The name of the RAM role.
    Value:
      Fn::GetAtt:
        - Role
        - RoleName
  Description:
    Description: The description of the RAM role.
    Value:
      Fn::GetAtt:
        - Role
        - Description
  Arn:
    Description: The ARN of the RAM role.
    Value:
      Fn::GetAtt:
        - Role
        - Arn
  RoleId:
    Description: The ID of the RAM role.
    Value:
      Fn::GetAtt:
        - Role
        - RoleId
  CreateDate:
    Description: The time when the RAM role was created.
    Value:
      Fn::GetAtt:
        - Role
        - CreateDate
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RoleName": {
      "Type": "String",
      "Description": {
        "en": "RAM role name. If not specified, the current ram role will be used."
      },
      "Required": false,
      "AssociationProperty": "ALIYUN::RAM::Role"
    }
  },
  "Resources": {
    "Role": {
      "Type": "DATASOURCE::RAM::Role",
      "Properties": {
        "RoleName": {
          "Ref": "RoleName"
        }
      }
    }
  },
  "Outputs": {
    "MaxSessionDuration": {
      "Description": "The maximum session duration of the RAM role.",
      "Value": {
        "Fn::GetAtt": [
          "Role",
          "MaxSessionDuration"
        ]
      }
    },
    "UpdateDate": {
      "Description": "The time when the RAM role was last updated.",
      "Value": {
        "Fn::GetAtt": [
          "Role",
          "UpdateDate"
        ]
      }
    },
    "RoleName": {
      "Description": "The name of the RAM role.",
      "Value": {
        "Fn::GetAtt": [
          "Role",
          "RoleName"
        ]
      }
    },
    "Description": {
      "Description": "The description of the RAM role.",
      "Value": {
        "Fn::GetAtt": [
          "Role",
          "Description"
        ]
      }
    },
    "Arn": {
      "Description": "The ARN of the RAM role.",
      "Value": {
        "Fn::GetAtt": [
          "Role",
          "Arn"
        ]
      }
    },
    "RoleId": {
      "Description": "The ID of the RAM role.",
      "Value": {
        "Fn::GetAtt": [
          "Role",
          "RoleId"
        ]
      }
    },
    "CreateDate": {
      "Description": "The time when the RAM role was created.",
      "Value": {
        "Fn::GetAtt": [
          "Role",
          "CreateDate"
        ]
      }
    }
  }
}