All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::RAM::Role

更新时间:Feb 05, 2025

DATASOURCE::RAM::Role is used to query the information about a role.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

RoleName

String

No

Yes

The role name.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values

Fn::GetAtt

  • MaxSessionDuration: the maximum session duration of the role.

  • UpdateDate: the time when the role was updated.

  • RoleName: the role name.

  • Description: the description of the role.

  • Arn: the Alibaba Cloud Resource Name (ARN) of the role.

  • RoleId: the role ID.

  • CreateDate: the time when the role was created.

Examples

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"
        ]
      }
    }
  }
}