All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::RAM::AttachPolicyToUser

Last Updated:Aug 20, 2026

The ALIYUN::RAM::AttachPolicyToUser resource attaches a policy to a specified user.

Syntax

{
  "Type": "ALIYUN::RAM::AttachPolicyToUser",
  "Properties": {
    "PolicyType": String,
    "UserName": String,
    "PolicyName": String
  }
}

Properties

Property NameTypeRequiredUpdate allowedDescriptionConstraints
PolicyTypeStringYesNoThe type of the access policy.Valid values:
  • System
  • Custom
UserNameStringYesNoThe username.None.
PolicyNameStringYesNoThe name of the access policy.None.

Return values

Fn::GetAtt

None.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      AttachPolicyToUser:
        Type: ALIYUN::RAM::AttachPolicyToUser
        Properties:
          PolicyType: Custom
          UserName: dev
          PolicyName: TestPolicy
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "AttachPolicyToUser": {
          "Type": "ALIYUN::RAM::AttachPolicyToUser",
          "Properties": {
            "PolicyType": "Custom",
            "UserName": "dev",
            "PolicyName": "TestPolicy"
          }
        }
      }
    }