全部產品
Search
文件中心

Cloud Parallel File Storage:檔案儲存體CPFS服務關聯角色

更新時間:Nov 15, 2024

為了完成CPFS智算版檔案系統的某個功能,檔案儲存體將自動建立CPFS服務關聯角色,以擷取訪問Virtual Private CloudObject Storage ServiceOSS等雲端服務的許可權。

背景資訊

服務關聯角色是一種可信實體為阿里雲服務的RAM角色。Cloud Parallel File Storage使用服務關聯角色擷取其他雲端服務或雲資源的存取權限。

通常情況下,服務關聯角色是在您執行某項操作時,由系統自動建立。在自動建立服務關聯角色失敗或Cloud Parallel File Storage不支援自動建立時,您需要手動建立服務關聯角色。

阿里雲存取控制為每個服務關聯角色提供了一個系統權限原則,該策略不支援修改。如果您想瞭解該系統策略的具體內容,可前往指定服務關聯角色的詳情頁面查看。

說明

關於服務關聯角色的更多資訊,請參見服務關聯角色

應用情境

CPFS服務關聯角色的應用情境如下:

  • AliyunServiceRoleForNasCpfsNetwork

    CPFS檔案系統在建立或刪除彈性網卡、安全性群組時,需要通過AliyunServiceRoleForNasCpfsNetwork角色訪問您的Virtual Private Cloud服務與Elastic Compute Service服務。

  • AliyunServiceRoleForNasCpfsClient

    CPFS檔案系統在建立或刪除ECS、雲助手、授權資訊及安全性群組時,需要通過AliyunServiceRoleForNasCpfsClient角色訪問您的Virtual Private Cloud服務與Elastic Compute Service服務。

  • AliyunServiceRoleForNasOssDataFlow

    使用CPFS檔案系統資料流動服務時,需要通過AliyunServiceRoleForNasOssDataFlow角色查詢和讀寫Object Storage Service中指定Bucket的資料。

  • AliyunServiceRoleForNasEventNotification

    使用CPFS檔案系統資料流動服務時,需要通過AliyunServiceRoleForNasEventNotification角色建立和修改EventBridge相關參數。

更多服務關聯角色的資訊,請參見服務關聯角色

許可權說明

CPFS服務關聯角色的許可權內容如下:

AliyunServiceRoleForNasCpfsNetwork

{
    "Version": "1",
    "Statement": [{
            "Action": [
                "vpc:DescribeVSwitchAttributes",
                "vpc:DescribeVpcs",
                "vpc:DescribeVSwitches"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ecs:CreateSecurityGroup",
                "ecs:DescribeSecurityGroups",
                "ecs:CreateNetworkInterface",
                "ecs:DeleteNetworkInterface",
                "ecs:DescribeNetworkInterfaces",
                "ecs:CreateNetworkInterfacePermission",
                "ecs:DescribeNetworkInterfacePermissions",
                "ecs:DeleteNetworkInterfacePermission"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeSecurityGroupAttribute",
                "ecs:DeleteSecurityGroup",
                "ecs:AuthorizeSecurityGroup",
                "ecs:AuthorizeSecurityGroupEgress",
                "ecs:RevokeSecurityGroup",
                "ecs:RevokeSecurityGroupEgress"
            ],
            "Resource": "acs:ecs:*:*:*/*",
            "Condition": {
                "StringEqualsIgnoreCase": {
                    "ecs:tag/nas:cpfs": "true"
                }
            }
        },
        {
            "Action": "ram:DeleteServiceLinkedRole",
            "Resource": "*",
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": "cpfs-network.nas.aliyuncs.com"
                }
            }
        }
    ]
}
      

AliyunServiceRoleForNasCpfsClient

{
 "Version": "1",
 "Statement": [
 {
 "Action": [
 "vpc:DescribeVSwitchAttributes",
 "vpc:DescribeVpcs",
 "vpc:DescribeVSwitches"
 ],
 "Resource": "*",
 "Effect": "Allow"
 },
 {
 "Action": [
 "ecs:RunInstances",
 "ecs:CreateInstance",
 "ecs:DescribeInstances",
 "ecs:CreateSecurityGroup",
 "ecs:DescribeSecurityGroups",
 "ecs:InstallCloudAssistant",
 "ecs:DescribeInvocations"
 ],
 "Resource": "*",
 "Effect": "Allow"
 },
 {
 "Effect": "Allow",
 "Action": [
 "ecs:StartInstances",
 "ecs:DeleteInstances",
 "ecs:RunCommand",
 "ecs:DescribeSecurityGroupAttribute",
 "ecs:DeleteSecurityGroup",
 "ecs:AuthorizeSecurityGroup",
 "ecs:AuthorizeSecurityGroupEgress",
 "ecs:RevokeSecurityGroup",
 "ecs:RevokeSecurityGroupEgress"
 ],
 "Resource": "acs:ecs:*:*:*/*",
 "Condition": {
 "StringEqualsIgnoreCase": {
 "ecs:tag/nas:cpfs": "true"
 }
 }
 },
 {
 "Action": "ram:DeleteServiceLinkedRole",
 "Resource": "*",
 "Effect": "Allow",
 "Condition": {
 "StringEquals": {
 "ram:ServiceName": "cpfs-client.nas.aliyuncs.com"
 }
 }
 } 
 ]
 }
 

AliyunServiceRoleForNasOssDataFlow

{
 "Statement": [
 {
 "Effect": "Allow",
 "Action": [
 "oss:ListBuckets",
 "oss:GetBucketTagging"
 ],
 "Resource": [
 "acs:oss:*:*:*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "oss:HeadBucket",
 "oss:GetBucketLocation",
 "oss:GetBucketInventory",
 "oss:GetBucketInfo",
 "oss:GetBucketVersion",
 "oss:GetBucketAcl",
 "oss:GetBucketStat",
 "oss:GetBucket",
 "oss:ListObjects",
 "oss:GetObject",
 "oss:PutObject",
 "oss:CopyObject",
 "oss:AppendObject",
 "oss:DeleteObject",
 "oss:GetObjectMeta",
 "oss:PutObjectACL",
 "oss:GetObjectACL",
 "oss:PutObjectTagging",
 "oss:GetObjectTagging",
 "oss:InitiateMultipartUpload",
 "oss:CompleteMultipartUpload",
 "oss:AbortMultipartUpload",
 "oss:ListMultipartUploads",
 "oss:UploadPart",
 "oss:UploadPartCopy",
 "oss:ListParts"
 ],
 "Resource": [
 "acs:oss:*:*:*",
 "acs:oss:*:*:*/*"
 ],
 "Condition": {
 "StringEqualsIgnoreCase": {
 "oss:tag/cpfs-dataflow": "true"
 }
 }
 },
 {
 "Action": "ram:DeleteServiceLinkedRole",
 "Resource": "*",
 "Effect": "Allow",
 "Condition": {
 "StringEquals": {
 "ram:ServiceName": "oss-dataflow.nas.aliyuncs.com"
 }
 }
 }
 ],
 "Version": "1"
}
 

AliyunServiceRoleForNasEventNotification

{
 "Statement": [
 {
 "Effect": "Allow",
 "Action": [
 "eventbridge:GetEventBus",
 "eventbridge:CreateRule"
 ],
 "Resource": [
 "acs:eventbridge:*:*:*"
 ]
 },
 {
 "Effect": "Allow",
 "Action": [
 "eventbridge:GetRule",
 "eventbridge:ListRules",
 "eventbridge:UpdateRule",
 "eventbridge:EnableRule",
 "eventbridge:DisableRule",
 "eventbridge:DeleteRule",
 "eventbridge:CreateTargets",
 "eventbridge:UpdateTargets",
 "eventbridge:DeleteTargets"
 ],
 "Resource": [
 "acs:eventbridge:*:*:*"
 ]
 },
 {
 "Action": "ram:DeleteServiceLinkedRole",
 "Resource": "*",
 "Effect": "Allow",
 "Condition": {
 "StringEquals": {
 "ram:ServiceName": "event-notification.nas.aliyuncs.com"
 }
 }
 }
 ],
 "Version": "1"
}
 

RAM使用者使用服務關聯角色需要的許可權

如果使用RAM使用者建立或刪除服務關聯角色,必須聯絡管理員為該RAM使用者授予管理員權限(AliyunNASFullAccess)或在自訂權限原則的Action語句中為RAM使用者添加以下許可權:

  • 建立服務關聯角色:ram:CreateServiceLinkedRole

  • 刪除服務關聯角色:ram:DeleteServiceLinkedRole

關於授權的詳細操作,請參見建立和刪除服務關聯角色所需的許可權

查看服務關聯角色

當服務關聯角色建立成功後,您可以在RAM控制台的角色頁面,通過搜尋服務關聯角色名稱(例如,AliyunServiceRoleForNasStandard)查看該服務關聯角色的以下資訊:

  • 基本資料

    在AliyunServiceRoleForNasStandard角色詳情頁面的基本資料地區,查看角色基本資料,包括角色名稱、建立時間、角色ARN和備忘等。

  • 權限原則

    在AliyunServiceRoleForNasStandard角色詳情頁面的許可權管理頁簽,單擊權限原則名稱,查看權限原則內容以及該角色可授權訪問哪些雲資源。

  • 信任策略

    在AliyunServiceRoleForNasStandard角色詳情頁的信任策略頁簽,查看信任策略內容。信任策略是描述RAM角色可信實體的策略,可信實體是指可以扮演RAM角色的實體使用者身份。服務關聯角色的可信實體為雲端服務,您可以通過信任策略中的Service欄位查看。

關於如何查看服務關聯角色的詳細操作,請參見查看RAM角色

刪除CPFS服務關聯角色

如果您暫時不需要使用CPFS服務關聯角色,例如不再使用CPFS檔案系統的資料流動功能時,可以刪除CPFS服務關聯角色。刪除時,請先刪除該角色關聯的CPFS檔案系統執行個體。具體操作,請參見刪除檔案系統刪除服務關聯角色

重要

刪除服務關聯角色後,依賴該角色的對應功能將無法正常使用,請謹慎刪除。

常見問題

為什麼RAM使用者無法自動建立CPFS服務關聯角色?

RAM使用者需要擁有指定的許可權,才能自動建立或刪除CPFS服務關聯角色。因此,在RAM使用者無法自動建立CPFS服務關聯角色時,您需要為其添加以下系統策略和自訂策略。具體操作,請參見建立自訂權限原則

  • 系統策略

    • AliyunVPCFullAccess:管理Virtual Private Cloud的許可權。

    • AliyunBSSFullAccess:管理費用中心BSS的許可權。

    • AliyunNASFullAccess:管理Apsara File Storage NAS的許可權。

    • AliyunECSNetworkInterfaceManagementAccess:管理ECS彈性網卡的許可權。

  • 自訂策略

    • 管理掛載點,需要cpfs-network.nas.aliyuncs.comcpfs-client.nas.aliyuncs.com許可權。

    • 管理資料流動,需要oss-dataflow.nas.aliyuncs.comevent-notification.nas.aliyuncs.com許可權。

    樣本如下:

    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "ram:CreateServiceLinkedRole"
          ],
          "Resource": "*",
          "Condition": {
            "StringEquals": { 
             "ram:ServiceName": [
                "cpfs-network.nas.aliyuncs.com",
                "cpfs-client.nas.aliyuncs.com",
                "oss-dataflow.nas.aliyuncs.com",
                "event-notification.nas.aliyuncs.com" 
             ]
            }
          }
        }
      ]
    }