文档

授权信息

更新时间:
访问控制(RAM)是阿里云提供的管理用户身份与资源访问权限的服务。使用RAM可以让您避免与其他用户共享阿里云账号密钥,并可按需为用户授予最小权限。RAM中使用权限策略描述授权的具体内容。
本文为您介绍轻量应用服务器(SimpleApplicationServer)为RAM权限策略定义的操作(Action)、资源(Resource)和条件(Condition)。轻量应用服务器(SimpleApplicationServer)的RAM代码(RamCode)为swas,swas-open,支持的授权粒度为RESOURCE

权限策略通用结构

权限策略支持JSON格式,其通用结构如下:
{
  "Version": "1",
  "Statement": [
    {
      "Effect": "<Effect>",
      "Action": "<Action>",
      "Resource": "<Resource>",
      "Condition": {
        "<Condition_operator>": {
          "<Condition_key>": [
            "<Condition_value>"
          ]
        }
      }
    }
  ]
}
各字段含义如下:
  • Effect:权限策略效果。取值:Allow(允许)、Deny(拒绝)。
  • Action:授予允许或拒绝权限的具体操作。具体信息,请参见操作(Action)
  • Resource:受操作影响的具体对象,您可以使用资源ARN来描述指定资源。具体信息,请参见资源(Resource)
  • Condition:指授权生效的条件。可选字段。具体信息,请参见条件(Condition)
    • Condition_operator:条件运算符,不同类型的条件对应不同的条件运算符。具体信息,请参见权限策略基本元素
    • Condition_key:条件关键字。
    • Condition_value:条件关键字对应的值。

操作(Action)

下表是轻量应用服务器(SimpleApplicationServer)定义的操作,这些操作可以在RAM权限策略语句的Action元素中使用,用来授予执行该操作的权限。下面对表中的具体项提供说明:
  • 操作:是指具体的权限点。
  • API:是指操作对应的API接口。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。该列不体现适用于任何操作的通用条件关键字
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作API访问级别资源类型条件关键字关联操作
swas-open:CreateFirewallRuleCreateFirewallRulecreate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:CreateCustomImageCreateCustomImagecreate
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/*
swas-open:UntagResourcesUntagResources
全部资源
*
swas-open:StartTerminalSessionStartTerminalSession
全部资源
*
swas-open:DescribeInvocationResultDescribeInvocationResultget
Instance
acs:swas-open:{#regionId}:{#accountId}:command/{#InstanceId}
swas-open:DescribeInstancePasswordsSettingDescribeInstancePasswordsSettingget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:ListFirewallRulesListFirewallRulesget
FirewallRule
acs:swas-open:{#regionId}:{#accountId}:firewallrule/*
swas-open:ResetDatabaseAccountPasswordResetDatabaseAccountPasswordupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:DescribeDatabaseInstanceMetricDataDescribeDatabaseInstanceMetricDataget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:ListInstancesListInstancesget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/*
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:EnableFirewallRuleEnableFirewallRuleupdate
FirewallRule
acs:swas-open:{#regionId}:{#accountId}:firewallrule/{#RuleId}
swas-open:StartInstanceStartInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:ListInstancesTrafficPackagesListInstancesTrafficPackagesget
全部资源
*
swas-open:RebootInstanceRebootInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:CreateKeyPairCreateKeyPaircreate
全部资源
*
swas-open:RemoveCustomImageShareAccountRemoveCustomImageShareAccountnone
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageId}
swas-open:DescribeMonitorDataDescribeMonitorDataget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:DescribeDatabaseSlowLogRecordsDescribeDatabaseSlowLogRecordsget
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:DescribeInstanceKeyPairDescribeInstanceKeyPairget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:RenewInstanceRenewInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:DeleteFirewallRulesDeleteFirewallRulesdelete
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:DeleteKeyPairsDeleteKeyPairsdelete
全部资源
*
swas-open:ImportKeyPairImportKeyPaircreate
全部资源
*
swas-open:StopInstanceStopInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:UpdateSnapshotAttributeUpdateSnapshotAttributeupdate
Snapshot
acs:swas-open:{#regionId}:{#accountId}:snapshot/{#SnapshotId}
swas-open:DeleteSnapshotDeleteSnapshotdelete
Snapshot
acs:swas-open:{#regionId}:{#accountId}:snapshot/{#SnapshotId}
swas-open:ReleasePublicConnectionReleasePublicConnectiondelete
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:DeleteFirewallRuleDeleteFirewallRuledelete
FirewallRule
acs:swas-open:{#regionId}:{#accountId}:firewallrule/{#RuleId}
swas-open:ListImagesListImagesget
全部资源
*
swas-open:StartDatabaseInstanceStartDatabaseInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:DescribeFirewallTemplateApplyResultsDescribeFirewallTemplateApplyResultslist
全部资源
*
swas-open:DescribeDatabaseErrorLogsDescribeDatabaseErrorLogsget
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:CreateFirewallRulesCreateFirewallRulescreate
FirewallRule
acs:swas-open:{#regionId}:{#accountId}:firewallrule/*
swas-open:ModifyDatabaseInstanceParameterModifyDatabaseInstanceParameterupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:TagResourcesTagResources
全部资源
*
swas-open:UpdateDiskAttributeUpdateDiskAttributeupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DiskId}
swas-open:ResetDiskResetDiskupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DiskId}
swas-open:ListSnapshotsListSnapshotsget
Snapshot
acs:swas-open:{#regionId}:{#accountId}:snapshot/*
Snapshot
acs:swas-open:{#regionId}:{#accountId}:snapshot/{#SnapshotId}
swas-open:DeleteCustomImagesDeleteCustomImagesdelete
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageIds}
swas-open:DescribeSecurityAgentStatusDescribeSecurityAgentStatusget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:DescribeCloudMonitorAgentStatusesDescribeCloudMonitorAgentStatusesget
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:ListInstancePlansModificationListInstancePlansModificationget
全部资源
*
swas-open:DescribeCloudAssistantAttributesDescribeCloudAssistantAttributesget
全部资源
*
swas-open:ResetSystemResetSystemupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:ModifyDatabaseInstanceDescriptionModifyDatabaseInstanceDescriptionupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:ListTagResourcesListTagResources
全部资源
*
swas-open:DisableFirewallRuleDisableFirewallRuleupdate
FirewallRule
acs:swas-open:{#regionId}:{#accountId}:firewallrule/{#RuleId}
swas-open:DescribeCloudAssistantStatusDescribeCloudAssistantStatusget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:ModifyFirewallRuleModifyFirewallRuleupdate
FirewallRule
acs:swas-open:{#regionId}:{#accountId}:firewallrule/{#RuleId}
swas-open:ModifyFirewallTemplateModifyFirewallTemplateupdate
FirewallTemplate
acs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplateId}
swas-open:DeleteSnapshotsDeleteSnapshotsdelete
Snapshot
acs:swas-open:{#regionId}:{#accountId}:snapshot/{#SnapshotIds}
swas-open:DescribeInvocationsDescribeInvocationsget
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:DescribeDatabaseInstanceParametersDescribeDatabaseInstanceParametersget
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:DeleteFirewallTemplatesDeleteFirewallTemplatesdelete
FirewallTemplate
acs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplateId}
swas-open:UpdateCommandAttributeUpdateCommandAttributeupdate
Command
acs:swas-open:{#regionId}:{#accountId}:command/{#CommandId}
swas-open:ListInstanceStatusListInstanceStatusget
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:DescribeCommandInvocationsDescribeCommandInvocationsget
全部资源
*
swas-open:ListKeyPairsListKeyPairsget
全部资源
*
swas-open:StopDatabaseInstanceStopDatabaseInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:RebootInstancesRebootInstancesupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:StopInstancesStopInstancesupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:DescribeFirewallTemplatesDescribeFirewallTemplateslist
全部资源
*
swas-open:DeleteCommandDeleteCommanddelete
Command
acs:swas-open:{#regionId}:{#accountId}:{#CommandId}
swas-open:RunCommandRunCommandcreate
Command
acs:swas-open:{#regionId}:{#accountId}:{#CommandId}
swas-open:ListDisksListDisksget
Disk
acs:swas-open:{#regionId}:{#accountId}:disk/{#DiskId}
Disk
acs:swas-open:{#regionId}:{#accountId}:disk/*
swas-open:CreateSnapshotCreateSnapshotcreate
Snapshot
acs:swas-open:{#regionId}:{#accountId}:snapshot/*
swas-open:DescribeCommandsDescribeCommandsget
全部资源
*
swas-open:UploadInstanceKeyPairUploadInstanceKeyPaircreate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:CreateFirewallTemplateRulesCreateFirewallTemplateRulescreate
FirewallTemplate
acs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplatId}
swas-open:StartInstancesStartInstancesupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:ListCustomImagesListCustomImagesget
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/*
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/{#CustomImageId}
swas-open:DetachKeyPairDetachKeyPairupdate
全部资源
*
swas-open:DeleteFirewallTemplateRulesDeleteFirewallTemplateRulesdelete
FirewallTemplate
acs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplateId}
swas-open:ModifyInstanceVncPasswordModifyInstanceVncPasswordupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:LoginInstanceLoginInstancenone
Instance
acs:swas-open:{#regionId}:{#accountId}:Instance/{#InstanceId}
swas-open:AttachKeyPairAttachKeyPairupdate
全部资源
*
swas-open:DescribeFirewallTemplateRulesApplyResultDescribeFirewallTemplateRulesApplyResultlist
FirewallTemplate
acs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplateId}
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:CreateFirewallTemplateCreateFirewallTemplatecreate
全部资源
*
swas-open:InvokeCommandInvokeCommand
全部资源
*
swas-open:AddCustomImageShareAccountAddCustomImageShareAccountnone
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageId}
swas-open:DeleteInstanceKeyPairDeleteInstanceKeyPairdelete
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:DeleteCustomImageDeleteCustomImagedelete
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageId}
swas-open:InstallCloudMonitorAgentInstallCloudMonitorAgentcreate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:UpgradeInstanceUpgradeInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:AllocatePublicConnectionAllocatePublicConnectioncreate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:RestartDatabaseInstanceRestartDatabaseInstanceupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
swas-open:ListCustomImageShareAccountsListCustomImageShareAccountsnone
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageId}
swas-open:UpdateInstanceAttributeUpdateInstanceAttributeupdate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:InstallCloudAssistantInstallCloudAssistantcreate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:CreateInstanceKeyPairCreateInstanceKeyPaircreate
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:CreateCommandCreateCommandcreate
Command
acs:swas-open:{#regionId}:{#accountId}:command/*
swas-open:DescribeInstanceVncUrlDescribeInstanceVncUrlget
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:DescribeDatabaseInstancesDescribeDatabaseInstancesget
Instance
acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
swas-open:ModifyImageShareStatusModifyImageShareStatusupdate
CustomImage
acs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageId}
swas-open:ApplyFirewallTemplateApplyFirewallTemplateupdate
FirewallTemplate
acs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplateId}
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
swas-open:CreateInstancesCreateInstancescreate
Instance
acs:swas-open:{#regionId}:{#accountId}:instance/*

资源(Resource)

下表是轻量应用服务器(SimpleApplicationServer)定义的资源,这些资源可以在RAM权限策略语句的Resource元素中使用,用来授予对该资源执行具体操作的权限。 其中,资源ARN是资源在阿里云上的唯一标识。具体说明如下:
  • {#}为变量标识,需要您替换为实际值。例如:{#ramcode}需要您替换为实际的云服务RAM代码。
  • *表示全部。例如:
    • {#resourceType}*时:表示全部资源。
    • {#regionId}*时:表示全部地域。
    • {#accountId}*时:表示全部阿里云账号。
资源类型资源ARN
Instanceacs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId}
ContainerServiceacs:swas-open:{#regionId}:{#accountId}:containerservice/{#ContainerServiceId}
CustomImageacs:swas-open:{#regionId}:{#accountId}:customimage/*
Instanceacs:swas-open:{#regionId}:{#accountId}:command/{#InstanceId}
FirewallRuleacs:swas-open:{#regionId}:{#accountId}:firewallrule/*
ContainerServiceacs:swas-open:{#regionId}:{#accountId}:containerservice/*
Instanceacs:swas-open:{#regionId}:{#accountId}:instance/{#DatabaseInstanceId}
Instanceacs:swas-open:{#regionId}:{#accountId}:instance/*
FirewallRuleacs:swas-open:{#regionId}:{#accountId}:firewallrule/{#RuleId}
CustomImageacs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageId}
Instanceacs:swas-open:{#regionId}:{#accountId}:{#InstanceId}
Diskacs:swas-open:{#regionId}:{#accountId}:disk/*
Snapshotacs:swas-open:{#regionId}:{#accountId}:snapshot/{#SnapshotId}
FirewallTemplateacs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplateId}
FirewallTemplateacs:swas-open:{#regionId}:{#accountId}:FirewallTemplate/*
Instanceacs:swas-open:{#regionId}:{#accountId}:instance/{#DiskId}
Snapshotacs:swas-open:{#regionId}:{#accountId}:snapshot/*
CustomImageacs:swas-open:{#regionId}:{#accountId}:customimage/{#ImageIds}
ContainerServiceacs:swas-open:{#regionId}:{#accountId}:containerservice/{#containerServiceId}
Snapshotacs:swas-open:{#regionId}:{#accountId}:snapshot/{#SnapshotIds}
Commandacs:swas-open:{#regionId}:{#accountId}:command/{#CommandId}
KeyPairacs:swas-open:{#regionId}:{#accountId}:Keypair/*
FirewallTemplateacs:swas-open:{#regionId}:{#accountId}:FirewallTemplate/{#FirewallTempalteId}
Commandacs:swas-open:{#regionId}:{#accountId}:{#CommandId}
Commandacs:simpleapplicationserver:{#regionId}:{#accountId}:command/{#CommandId}
Diskacs:swas-open:{#regionId}:{#accountId}:disk/{#DiskId}
Commandacs:swas-open:{#regionId}:{#accountId}:command/*
FirewallTemplateacs:swas-open:{#regionId}:{#accountId}:firewalltemplate/{#FirewallTemplatId}
CustomImageacs:swas-open:{#regionId}:{#accountId}:customimage/{#CustomImageId}
Instanceacs:swas-open:{#regionId}:{#accountId}:Instance/{#InstanceId}
FirewallTemplateacs:swas-open:{#regionId}:{#accountId}:firewalltemplate/*
Diskacs:swas-open:{#regionId}:{#accountId}:disk/{#ResourceId}
Commandacs:swas-open:{#regionId}:{#accountId}:command/{#ResourceId}
CustomImageacs:swas-open:{#regionId}:{#accountId}:customimage/{#ResourceId}
Instanceacs:swas-open:{#regionId}:{#accountId}:instance/{#ResourceId}
Snapshotacs:swas-open:{#regionId}:{#accountId}:snapshot/{#ResourceId}
FirewallRuleacs:swas-open:{#regionId}:{#accountId}:firewallrule/{#ResourceId}

条件(Condition)

轻量应用服务器(SimpleApplicationServer)未定义产品级别的条件关键字。如需查看适用于所有云产品的通用条件关键字,请参见通用条件关键字

相关操作

您可以创建自定义权限策略,并将权限策略授予RAM用户、RAM用户组或RAM角色。具体操作如下: