授权信息

更新时间:
复制为 MD 格式

访问控制(RAM)是阿里云提供的管理用户身份与资源访问权限的服务。使用 RAM 可以让您避免与其他用户共享阿里云账号密钥,并可按需为用户授予最小权限。RAM 中使用权限策略描述授权的具体内容。

本文为您介绍 函数计算 为 RAM 权限策略定义的操作(Action)、资源(Resource)和条件(Condition)。 函数计算 的 RAM 代码(RamCode)为 agentrun ,支持的授权粒度为 资源级

权限策略通用结构

权限策略支持 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)

下表是函数计算定义的操作,这些操作可以在 RAM 权限策略语句的Action元素中使用,用来授予执行该操作的权限。下面对表中的具体项提供说明:

  • 操作:是指具体的权限点。

  • API:是指操作对应的 API 接口。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。该列不体现适用于任何操作的通用条件关键字

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

API

访问级别

资源类型

条件关键字

关联操作

agentrun:CreateSandbox CreateSandbox create

*全部资源

*

agentrun:CreateTemplate CreateTemplate create

*全部资源

*

agentrun:DeleteModelService DeleteModelService delete

*全部资源

*

agentrun:GetFlowVersion GetFlowVersion get

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}

agentrun:CreateIMBot CreateIMBot create

*全部资源

*

agentrun:CreateBrowser CreateBrowser create

*全部资源

*

agentrun:ListModelProxies ListModelProxies list

*全部资源

*

agentrun:GetWorkspace GetWorkspace get

*Workspace

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}

agentrun:ListAgentRuntimeVersions ListAgentRuntimeVersions list

*全部资源

*

agentrun:ResumeSandbox ResumeSandbox update

*全部资源

*

agentrun:GetTool GetTool get

*Tool

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/tools/{#toolName}

agentrun:GetBrowser GetBrowser get

*全部资源

*

agentrun:ListAgentRuntimeEndpoints ListAgentRuntimeEndpoints list

*全部资源

*

agentrun:GetAgentRuntime GetAgentRuntime get

*Agent

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}

agentrun:ListCredentials ListCredentials list

*Credential

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/credentials/*

agentrun:CreateWorkspace CreateWorkspace create

*全部资源

*

agentrun:UpdateWorkspace UpdateWorkspace update

*Workspace

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}

agentrun:ListWorkspaces ListWorkspaces get

*全部资源

*

agentrun:GetCustomDomain GetCustomDomain get

*全部资源

*

agentrun:UpdateMemoryCollection UpdateMemoryCollection update

*全部资源

*

agentrun:GetCredential GetCredential get

*Credential

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/credentials/{#credentialName}

agentrun:CreateCustomDomain CreateCustomDomain create

*全部资源

*

agentrun:DeleteSandbox DeleteSandbox delete

*全部资源

*

agentrun:DeleteCodeInterpreter DeleteCodeInterpreter delete

*全部资源

*

agentrun:CreateModelService CreateModelService create

*全部资源

*

agentrun:DeleteWorkspace DeleteWorkspace delete

*Workspace

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}

agentrun:UpdateCredential UpdateCredential update

*Credential

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/credentials/{#credentialName}

agentrun:PublishRuntimeVersion PublishRuntimeVersion none

*Agent

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}

agentrun:GetMemoryCollection GetMemoryCollection get

*全部资源

*

agentrun:DeleteCustomDomain DeleteCustomDomain delete

*全部资源

*

agentrun:DeleteFlow DeleteFlow delete

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}

agentrun:ListTools ListTools list

*全部资源

*

agentrun:DeleteTemplate DeleteTemplate delete

*全部资源

*

agentrun:ListBrowsers ListBrowsers list

*全部资源

*

agentrun:ListFlowEndpoints ListFlowEndpoints list

*全部资源

*

agentrun:UpdateFlow UpdateFlow update

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}

agentrun:UpdateTool UpdateTool update

*Tool

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/tools/{#toolName}

agentrun:CreateCodeInterpreter CreateCodeInterpreter create

*全部资源

*

agentrun:CreateCredential CreateCredential create

*全部资源

*

agentrun:GetWorkspaceDiscoveryEndpoints GetWorkspaceDiscoveryEndpoints get

*Workspace

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}

agentrun:DeleteAgentRuntimeEndpoint DeleteAgentRuntimeEndpoint delete

*Endpoint

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}/runtime-endpoints/{#endpointName}

agentrun:GetTemplate GetTemplate get

*全部资源

*

agentrun:CreateTool CreateTool create

*Tool

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/tools/*

agentrun:UpdateFlowDraft UpdateFlowDraft update

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}

agentrun:ActivateTemplateMCP ActivateTemplateMCP update

*全部资源

*

agentrun:CreateAgentRuntime CreateAgentRuntime create

*Agent

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/*

agentrun:DeleteKnowledgeBase DeleteKnowledgeBase delete

*Knowledgebase

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/knowledgebases/{#knowledgeBaseName}

agentrun:UpdateKnowledgeBase UpdateKnowledgeBase update

*Knowledgebase

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/knowledgebases/{#knowledgeBaseName}

agentrun:CreateKnowledgeBase CreateKnowledgeBase create

*Knowledgebase

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/knowledgebases/*

agentrun:GetAgentRuntimeEndpoint GetAgentRuntimeEndpoint get

*Agent

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}/runtime-endpoints/{#endpointName}

agentrun:DeleteAgentRuntime DeleteAgentRuntime delete

*Agent

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}

agentrun:UpdateAgentRuntime UpdateAgentRuntime update

*Agent

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}

agentrun:ListCodeInterpreters ListCodeInterpreters list

*全部资源

*

agentrun:CreateMemoryCollection CreateMemoryCollection create

*全部资源

*

agentrun:ListSandboxes ListSandboxes list

*全部资源

*

agentrun:DeleteTool DeleteTool delete

*Tool

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/tools/{#toolName}

agentrun:ListCustomDomains ListCustomDomains list

*全部资源

*

agentrun:ListModelProviders ListModelProviders list

*全部资源

*

agentrun:GetModelService GetModelService get

*ModelService

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/model-services/{#modelServiceName}

agentrun:UpdateCustomDomain UpdateCustomDomain update

*全部资源

*

agentrun:UpdateModelService UpdateModelService update

*全部资源

*

agentrun:CreateAgentRuntimeEndpoint CreateAgentRuntimeEndpoint create

*全部资源

*

agentrun:ListKnowledgeBases ListKnowledgeBases list

*Knowledgebase

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/knowledgebases/*

agentrun:DeleteMemoryCollection DeleteMemoryCollection delete

*全部资源

*

agentrun:GetSandbox GetSandbox get

*全部资源

*

agentrun:ListMemoryCollections ListMemoryCollections list

*全部资源

*

agentrun:DeleteBrowser DeleteBrowser delete

*全部资源

*

agentrun:CreateFlow CreateFlow create

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/*

agentrun:ListModelServices ListModelServices list

*ModelService

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/model-services/*

agentrun:GetAccessToken GetAccessToken get

*全部资源

*

agentrun:UpdateTemplate UpdateTemplate update

*全部资源

*

agentrun:ListFlowVersions ListFlowVersions list

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}

agentrun:ListIMBots ListIMBots list

*全部资源

*

agentrun:PauseSandbox PauseSandbox update

*全部资源

*

agentrun:GetFlow GetFlow get

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}

agentrun:ListTemplates ListTemplates list

*全部资源

*

agentrun:StopSandbox StopSandbox delete

*全部资源

*

agentrun:GetFlowDraft GetFlowDraft get

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}

agentrun:GetCodeInterpreter GetCodeInterpreter get

*全部资源

*

agentrun:CreateModelProxy CreateModelProxy create

*全部资源

*

agentrun:GetKnowledgeBase GetKnowledgeBase get

*Knowledgebase

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/knowledgebases/{#knowledgeBaseName}

agentrun:DeleteCredential DeleteCredential delete

*Credential

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/credentials/{#credentialName}

agentrun:ListAgentRuntimes ListAgentRuntimes list

*Agent

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/*

agentrun:UpdateAgentRuntimeEndpoint UpdateAgentRuntimeEndpoint update

*Endpoint

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}/runtime-endpoints/{#endpointName}

agentrun:GetModelProxy GetModelProxy get

*全部资源

*

agentrun:ListFlows ListFlows list

*Flow

acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/*

资源(Resource)

下表是函数计算定义的资源,这些资源可以在 RAM 权限策略语句的Resource元素中使用,用来授予对该资源执行具体操作的权限。 其中,资源 ARN 是资源在阿里云上的唯一标识。具体说明如下:

  • {#}为变量标识,需要您替换为实际值。例如:{#ramcode}需要您替换为实际的云服务RAM代码。

  • *表示全部。例如:

    • {#resourceType}*时:表示全部资源。

    • {#regionId}*时:表示全部地域。

    • {#accountId}*时:表示全部阿里云账号。

资源类型

资源 ARN

SandboxTemplate
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/template/*
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/template/{#templateName}
ModelService
  • acs:agentrun:{#regionId}:{#accountId}:modelservice/*
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/model-services/{#modelServiceName}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/model-services/*
Flow
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/*
IMBot
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}/im-bots/{#botName}
ModelProxy
  • acs:agentrun:{#regionId}:{#accountId}:modelproxy/*
Workspace
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/*
Agent
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/*
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}/runtime-endpoints/{#endpointName}
FlowEndpoint
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}/endpoints/{#flowEndpointId}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/flows/{#flowId}/endpoints/*
Tool
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/tools/{#toolName}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/tools/*
Endpoint
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/runtimes/{#runtimeName}/runtime-endpoints/{#endpointName}
Credential
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/credentials/*
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/credentials/{#credentialName}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/{#resourceType}/{#resourceName}
MemoryCollection
  • acs:agentrun:{#regionId}:{#accountId}:memorycollection/*
Knowledgebase
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/knowledgebases/{#knowledgeBaseName}
  • acs:agentrun:{#regionId}:{#accountId}:workspaces/{#workspaceName}/knowledgebases/*

条件(Condition)

函数计算未定义产品级别的条件关键字。如需查看适用于所有云产品的通用条件关键字,请参见通用条件关键字

相关操作

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