全部产品
Search
文档中心

:NAS服务关联角色

更新时间:May 11, 2023

为了完成NAS文件系统的某个功能,NAS将自动创建NAS服务关联角色获取访问云服务器ECS、专有网络VPC等云服务的权限。

应用场景

NAS服务关联角色的应用场景如下:

  • AliyunServiceRoleForNasStandard

    创建通用型NAS文件系统的经典网络类型挂载点时,需要通过AliyunServiceRoleForNasStandard角色访问您的云服务器ECS服务,获取资源列表实现鉴权逻辑。

  • AliyunServiceRoleForNasExtreme

    极速型NAS文件系统创建挂载点时,需要通过AliyunServiceRoleForNasExtreme角色访问您的专有网络VPC服务与云服务器ECS服务。

  • AliyunServiceRoleForNasEncryption

    创建用户管理密钥(KMS)加密的文件系统时,需要通过AliyunServiceRoleForNasEncryption角色访问密钥管理服务KMS,获取您托管给密钥管理服务KMS的密钥信息,并为您选择的密钥添加标签,防止您误删除密钥导致文件系统不可用。

  • AliyunServiceRoleForNasLogDelivery

    使用NAS日志分析功能时,需要通过AliyunServiceRoleForNasLogDelivery角色访问日志服务SLS,并在您的日志服务中创建Project和Logstore,将NAS中存储的日志数据转储至Logstore中。

  • AliyunServiceRoleForNasBackup

    在创建通用型文件系统时,若要使用文件备份功能,需要通过AliyunServiceRoleForNasBackup角色开通混合云备份服务并创建备份计划。

  • AliyunServiceRoleForNasEcsHandler

    当您在NAS控制台使用一键挂载功能挂载文件系统时,需要通过AliyunServiceRoleForNasEcsHandler角色访问ECS云助手,并使用ECS云助手为一台或多台ECS实例触发一条云助手命令,实现挂载、卸载文件系统及查询ECS挂载状态。

更多服务关联角色的信息,请参见服务关联角色

权限说明

NAS服务关联角色的权限内容如下:

AliyunServiceRoleForNasStandard

{
 "Version": "1",
 "Statement": [
 {
 "Action": [
 "ecs:DescribeInstances" 
 ],
 "Resource": "*",
 "Effect": "Allow"
 }
 ]
}
 

AliyunServiceRoleForNasExtreme

{
 "Version": "1",
 "Statement": [
 {
 "Action": [
 "vpc:DescribeVSwitchAttributes",
 "vpc:DescribeVpcs",
 "vpc:DescribeVSwitches"
 ],
 "Resource": "*",
 "Effect": "Allow"
 },
 {
 "Action": [
 "ecs:CreateSecurityGroup", 
 "ecs:DescribeSecurityGroups",
 "ecs:DescribeSecurityGroupAttribute",
 "ecs:DeleteSecurityGroup", 
 "ecs:AuthorizeSecurityGroup", 
 "ecs:CreateNetworkInterface", 
 "ecs:DeleteNetworkInterface",
 "ecs:DescribeNetworkInterfaces",
 "ecs:CreateNetworkInterfacePermission", 
 "ecs:DescribeNetworkInterfacePermissions",
 "ecs:DeleteNetworkInterfacePermission"
 ],
 "Resource": "*",
 "Effect": "Allow"
 }
 ]
}
 

AliyunServiceRoleForNasEncryption

{
 "Statement": [
 {
 "Effect": "Allow",
 "Action": [
 "kms:Listkeys", 
 "kms:Listaliases",
 "kms:ListResourceTags",
 "kms:DescribeKey", 
 "kms:TagResource", 
 "kms:UntagResource"
 ],
 "Resource": "acs:kms:*:*:*"
 },
 {
 "Effect": "Allow",
 "Action": [
 "kms:Encrypt",
 "kms:Decrypt",
 "kms:GenerateDataKey"
 ],
 "Resource": "acs:kms:*:*:*/*",
 "Condition": {
 "StringEqualsIgnoreCase": {
 "kms:tag/acs:nas:instance-encryption": "true"
 }
 }
 }
 ],
 "Version": "1"
}
 

AliyunServiceRoleForNasLogDelivery

{
 "Version": "1",
 "Statement": [
 {
 "Action": [
 "log:PostLogStoreLogs"
 ],
 "Resource": "*",
 "Effect": "Allow"
 }
 ]
}
 

AliyunServiceRoleForNasBackup

{
	"Version": "1",
	"Statement": [{
			"Action": [
				"hbr:OpenHbrService",
				"hbr:CreateTrialBackupPlan"
			],
			"Resource": "*",
			"Effect": "Allow"
		},
		{
			"Action": "ram:DeleteServiceLinkedRole",
			"Resource": "*",
			"Effect": "Allow",
			"Condition": {
				"StringEquals": {
					"ram:ServiceName": "backup.nas.aliyuncs.com"
				}
			}
		},
		{
			"Action": "ram:CreateServiceLinkedRole",
			"Resource": "*",
			"Effect": "Allow",
			"Condition": {
				"StringEquals": {
					"ram:ServiceName": "nasbackup.hbr.aliyuncs.com"
				}
			}
		}
	]
}
 

AliyunServiceRoleForNasEcsHandler

{
 "Version": "1",
 "Statement": [
 {
 "Action": "ram:DeleteServiceLinkedRole",
 "Resource": "*",
 "Effect": "Allow",
 "Condition": {
 "StringEquals": {
 "ram:ServiceName": "ecs-handler.nas.aliyuncs.com"
 }
 }
 },
 {
 "Effect": "Allow",
 "Action": [
 "ecs:InvokeCommand"
 ],
 "Resource": [
 "acs:ecs:*:*:instance/*",
 "acs:ecs:*:*:command/cmd-ACS-NAS-ClickMount-*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "ecs:DescribeInstances",
 "ecs:DescribeCloudAssistantStatus"
 ],
 "Resource": [
 "acs:ecs:*:*:instance/*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "ecs:DescribeInvocations",
 "ecs:DescribeInvocationResults"
 ],
 "Resource": [
 "*"
 ]
 }
 ]
}
 

删除NAS服务关联角色

如果您暂时不需要使用NAS服务关联角色,例如不需要创建用户管理密钥(KMS)加密的文件系统时,可以删除NAS服务关联角色。删除时,请先删除该角色关联的文件系统实例。具体操作,请参见删除文件系统删除服务关联角色

常见问题

为什么我的RAM用户无法自动创建NAS服务关联角色?

只有拥有指定权限的RAM用户,才能自动创建或删除文件存储NAS服务关联角色。当RAM用户无法自动创建文件存储NAS服务关联角色时,需要为RAM用户添加以下权限策略。使用时请将主账号ID替换为实际的阿里云账号(主账号)ID。具体操作,请参见为RAM角色授权

{
    "Statement": [
        {
            "Action": [
                "ram:CreateServiceLinkedRole"
            ],
            "Resource": "acs:ram:*:主账号ID:role/*",
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": [
                        "standard.nas.aliyuncs.com",
                        "extreme.nas.aliyuncs.com",
                        "encryption.nas.aliyuncs.com",
                        "logdelivery.nas.aliyuncs.com",
                        "ecs-handler.nas.aliyuncs.com"
                    ]
                }
            }
        }
    ],
    "Version": "1"
}