cloud-onboarding
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCloud Onboarding
Elastic Cloud 组织入门配置
Stand up access to an Elastic Cloud organization end to end: configure the CLI so it can operate the control
plane, then manage identity and access — invite users, assign predefined or custom roles to Serverless projects, and
manage Cloud API keys. For creating and operating projects and deployments, use the cloud-provisioning skill.
elastic完整搭建Elastic Cloud组织的访问体系:配置 CLI以使其能够操作控制平面,然后管理身份与访问权限——邀请用户、为Serverless项目分配预定义或自定义角色,以及管理Cloud API密钥。如需创建和运营项目与部署,请使用cloud-provisioning技能。
elasticEnvironment Configuration
环境配置
This skill configures the CLI itself, so its setup lives here rather than being assumed. If the
CLI is not installed, tell the user what it is needed for.
elasticelasticCloud control-plane access is authenticated by an Elastic Cloud API key (organization scope), stored in a CLI
context. Register it without ever having the user paste the secret into the chat:
- Only Organization owners can create Cloud API keys. Direct the user to generate one at Elastic Cloud API keys with Project Admin privileges or higher so it can manage serverless projects.
- If the user has no Elastic Cloud account, propose the free Elastic Cloud trial (14 days, no credit card). Once registered, continue with key generation.
- Add the key to a context (the secret is stored in the OS keychain, not echoed):
, then make it active with
elastic config context add cloud --cloud-url https://api.elastic-cloud.com --cloud-api-key <KEY>.elastic config current-context set cloud
Do not guess credentials, bypass the CLI to call the HTTP API directly, or ask the user to reveal the key. This skill
references control-plane operations in HTTP-shorthand form with the prefix (for example,
); the Operations table maps each to the equivalent
command.
cloud:GET cloud:/api/v1/organizationselastic cloudFor detailed API schemas (role assignments, Cloud API keys, custom roles), see
references/api-reference.md. For Elasticsearch-level role management beyond Cloud roles
(native users, role mappings, DLS/FLS) see elasticsearch-authz.
本技能会配置 CLI本身,因此其设置流程包含在此处,而非默认已完成。如果未安装 CLI,请告知用户其用途。
elasticelasticCloud控制平面的访问通过Elastic Cloud API密钥(组织范围)进行身份验证,密钥存储在CLI的上下文中。注册密钥时,无需让用户在聊天框中粘贴密钥明文:
- 只有组织所有者可以创建Cloud API密钥。引导用户前往Elastic Cloud API密钥页面,生成拥有项目管理员或更高权限的密钥,用于管理Serverless项目。
- 如果用户没有Elastic Cloud账户,推荐免费的Elastic Cloud试用版(14天期限,无需信用卡)。注册完成后,继续生成密钥。
- 将密钥添加到上下文(密钥会存储在系统密钥链中,不会回显):
,然后执行
elastic config context add cloud --cloud-url https://api.elastic-cloud.com --cloud-api-key <KEY>将其设为活跃上下文。elastic config current-context set cloud
请勿猜测凭证、绕过CLI直接调用HTTP API,或要求用户透露密钥明文。本技能使用带前缀的HTTP简写形式引用控制平面操作(例如);操作列表表格会映射每个操作对应的命令。
cloud:GET cloud:/api/v1/organizationselastic cloud如需详细的API schema(角色分配、Cloud API密钥、自定义角色),请查看references/api-reference.md。如需Cloud角色之外的Elasticsearch级角色管理(原生用户、角色映射、DLS/FLS),请查看elasticsearch-authz技能。
Jobs to be done
待完成任务
- Configure and validate a Cloud context; establish a default region for later project creation
- Invite a user and assign a Serverless project role; list members and their roles; update or remove access
- Create, list, and revoke Cloud API keys, optionally with Elasticsearch/Kibana API access on projects
- Create a custom role in a Serverless project and assign it via the Cloud API's
application_roles - Translate a natural-language access request into invite, role, and API key tasks
- 配置并验证Cloud上下文;为后续项目创建设置默认区域
- 邀请用户并分配Serverless项目角色;列出成员及其角色;更新或移除访问权限
- 创建、列出和撤销Cloud API密钥,可选为其配置项目的Elasticsearch/Kibana API访问权限
- 在Serverless项目中创建自定义角色,并通过Cloud API的进行分配
application_roles - 将自然语言描述的访问请求转化为邀请、角色分配和API密钥管理任务
Process: validate the environment
流程:验证环境
-
Validate the Cloud context. Confirm the active context can reach the control plane by calling. A successful response lists the organizations the key belongs to and yields the organization ID other steps need. If it returns an authentication error, the context is missing or the key is invalid or expired — return to Environment Configuration and register a valid key. Do not proceed until validation succeeds, and never ask the user for the organization ID — discover it here.
GET cloud:/api/v1/organizations -
Establish a default region (optional). When the user plans to create projects, list the available regions withand confirm a default. Default to
GET cloud:/api/v1/serverless/regionsunless the user requests otherwise; only regions withgcp-us-central1accept new projects. Region choice is permanent per project, so surface it early.project_creation_enabled: true
-
验证Cloud上下文。通过调用确认活跃上下文能够连接到控制平面。成功响应会列出密钥所属的组织,并返回后续步骤所需的组织ID。如果返回身份验证错误,说明上下文缺失或密钥无效/过期——回到环境配置步骤注册有效密钥。验证成功前请勿继续,且切勿向用户索要组织ID——在此步骤自动获取。
GET cloud:/api/v1/organizations -
设置默认区域(可选)。当用户计划创建项目时,调用列出可用区域并确认默认区域。除非用户另有要求,否则默认使用
GET cloud:/api/v1/serverless/regions;仅gcp-us-central1的区域支持创建新项目。区域选择对每个项目是永久性的,因此需提前告知用户。project_creation_enabled: true
Permissions
权限
This skill does not pre-check roles; it attempts the operation and lets the API enforce authorization. On a , stop
and ask the user to verify the API key's permissions.
403| Operation | Required permission |
|---|---|
| Invite / remove members | Organization owner ( |
| Assign or remove roles | Organization owner ( |
| Create / revoke Cloud API keys | Organization owner ( |
| List members, invitations, or keys | Any organization member |
| Create / delete custom roles | |
本技能不会预先检查角色权限;会直接尝试执行操作,由API强制执行授权。如果返回错误,请停止操作并要求用户验证API密钥的权限。
403| 操作 | 所需权限 |
|---|---|
| 邀请/移除成员 | 组织所有者( |
| 分配/移除角色 | 组织所有者( |
| 创建/撤销Cloud API密钥 | 组织所有者( |
| 列出成员、邀请信息或密钥 | 任何组织成员 |
| 创建/删除自定义角色 | 项目ES端点的 |
Predefined roles
预定义角色
Prefer predefined roles; only create a custom role when they lack the required granularity.
Organization: (full admin), (billing only).
organization-adminbilling-adminServerless project roles (assign at invitation or via role-assignment update):
| Role | | Available on |
|---|---|---|
| Admin | | Search, Obs, Security |
| Developer | | Search |
| Viewer | | Search, Obs, Security |
| Editor | | Obs, Security |
| Analysts | | Security |
See references/api-reference.md for the full schema (organization,
deployment, and project scopes) and the complete Security role list.
role_assignments优先使用预定义角色;仅当预定义角色粒度不足时才创建自定义角色。
组织角色:(全权限管理员)、(仅账单管理)。
organization-adminbilling-adminServerless项目角色(可在邀请时或通过角色分配更新操作进行分配):
| 角色 | | 适用项目类型 |
|---|---|---|
| 管理员 | | Search、Obs、Security |
| 开发者 | | Search |
| 查看者 | | Search、Obs、Security |
| 编辑者 | | Obs、Security |
| 分析师 | | Security |
如需完整的 schema(组织、部署和项目范围)以及完整的Security角色列表,请查看references/api-reference.md。
role_assignmentsProcess: decompose an access request
流程:拆解访问请求
When the user describes access in natural language (for example, "add Alice to my search project as a developer"), break
it down before executing.
-
Identify components. Who (new invite vs existing member), what (which project or org-level), access level (predefined vs custom role), and whether an API key is also needed.
-
Check existing state first. List members withand, for key requests, existing keys with
GET cloud:/api/v1/organizations/{org_id}/members. If the user is already a member, update their roles instead of inviting. If an active key already exists for the same purpose with the right roles and enough remaining lifetime, reuse it.GET cloud:/api/v1/users/auth/keys -
Execute the smallest sufficient change.
- Invite a new member with (include project role assignments, or invite without roles when a custom role will follow).
POST cloud:/api/v1/organizations/{org_id}/invitations - Update an existing member's roles with ; remove with the
POST cloud:/api/v1/users/{user_id}/role_assignmentsvariant.DELETE - Remove a member with (confirm first).
DELETE cloud:/api/v1/organizations/{org_id}/members/{user_ids} - Create a Cloud API key with ; revoke with
POST cloud:/api/v1/users/auth/keys(confirm first). Confirm destructive actions (remove member, revoke key) with the user before executing.DELETE cloud:/api/v1/users/auth/keys
- Invite a new member with
-
Verify. List members or keys again to confirm the change took effect.
当用户用自然语言描述访问需求时(例如“将Alice添加到我的搜索项目中,赋予开发者权限”),请先拆解需求再执行操作。
-
识别核心要素:对象(新用户邀请 vs 现有成员)、范围(项目级 vs 组织级)、访问级别(预定义角色 vs 自定义角色),以及是否需要API密钥。
-
先检查现有状态。调用列出成员;对于密钥请求,调用
GET cloud:/api/v1/organizations/{org_id}/members列出已有密钥。如果用户已是成员,则更新其角色而非重新邀请。如果已有满足用途、角色正确且剩余有效期足够的活跃密钥,请复用该密钥。GET cloud:/api/v1/users/auth/keys -
执行最小必要变更:
- 邀请新成员:调用(包含项目角色分配,若后续将分配自定义角色则可不带角色邀请)。
POST cloud:/api/v1/organizations/{org_id}/invitations - 更新现有成员角色:调用;移除角色则使用
POST cloud:/api/v1/users/{user_id}/role_assignments变体。DELETE - 移除成员:调用(执行前需确认)。
DELETE cloud:/api/v1/organizations/{org_id}/members/{user_ids} - 创建Cloud API密钥:调用;撤销密钥则调用
POST cloud:/api/v1/users/auth/keys(执行前需确认)。执行破坏性操作(移除成员、撤销密钥)前必须获得用户确认。DELETE cloud:/api/v1/users/auth/keys
- 邀请新成员:调用
-
验证结果。再次列出成员或密钥,确认变更已生效。
Custom roles (Serverless)
自定义角色(Serverless)
When predefined roles lack the granularity, create a custom role in the project via the Elasticsearch security API and
assign it through the Cloud API's :
application_roles- Create the role in the project with (runs against the project's Elasticsearch endpoint; requires
PUT /_security/role/{name}). Role names must start with a letter or digit and contain only letters, digits,manage_security,_,-. Run-as privileges are not available in Serverless.. - Invite the user if needed — without project role assignments (the custom role handles project access).
- Assign the custom role by setting on a project-scoped role assignment (
application_roles) withPOST cloud:/api/v1/users/{user_id}/role_assignmentsset to the project-type viewer (role_id,elasticsearch-viewer,observability-viewer).security-viewer
Do not also assign a predefined Cloud role for the same project. A custom role already grants Viewer-level Cloud access; adding(or another predefined role) gives the user the union of both, widening access beyond what the custom role intends.viewer
当预定义角色粒度不足时,通过Elasticsearch安全API在项目中创建自定义角色,并通过Cloud API的进行分配:
application_roles- 调用在项目中创建角色(针对项目的Elasticsearch端点执行;需要
PUT /_security/role/{name}权限)。角色名称必须以字母或数字开头,且仅包含字母、数字、manage_security、_、-。Serverless环境不支持Run-as权限。. - 如需邀请用户——不要分配项目角色(自定义角色会处理项目访问权限)。
- 通过项目范围的角色分配设置来分配自定义角色:调用
application_roles,将POST cloud:/api/v1/users/{user_id}/role_assignments设为项目类型查看者(role_id、elasticsearch-viewer、observability-viewer)。security-viewer
请勿同时为同一项目分配预定义Cloud角色。自定义角色已授予查看者级别的Cloud访问权限;添加(或其他预定义角色)会让用户获得两种角色的权限合集,超出自定义角色的预期范围。viewer
Cloud API keys with stack access
具备栈访问权限的Cloud API密钥
Cloud API keys can also call Elasticsearch and Kibana APIs on Serverless projects by including in
their . Unlike users, API keys never inherit stack roles from — without
the key has Cloud-API-only access and receives on ES/Kibana calls.
application_rolesrole_assignmentsrole_idapplication_roles403- Default to project-scoped assignments (key) so the key only reaches named projects or all projects of a type.
project - Organization-scoped assignments (key) grant ES/Kibana access to all current and future projects — the broadest data-plane scope. Only use it for genuine cross-project automation, and confirm with the user first.
organization - Custom role names in must exist in each target project, or the key silently gets no access there. Predefined roles (
application_roles,admin,developer) exist in every project by default.viewer
Cloud API密钥也可通过在中包含,调用Serverless项目的Elasticsearch和Kibana API。与用户不同,API密钥不会从继承栈角色——如果没有,密钥仅具备Cloud API访问权限,调用ES/Kibana API会返回错误。
role_assignmentsapplication_rolesrole_idapplication_roles403- 默认使用项目范围的分配(字段),确保密钥仅能访问指定项目或指定类型的所有项目。
project - 组织范围的分配(字段)会授予对所有当前及未来项目的ES/Kibana访问权限——这是最宽泛的数据平面范围。仅在真正需要跨项目自动化时使用,且需先获得用户确认。
organization - 中的自定义角色名称必须在每个目标项目中存在,否则密钥在该项目中将无访问权限。预定义角色(
application_roles、admin、developer)默认存在于所有项目中。viewer
Examples
示例
"Set up my cloud environment" — verify a Cloud context exists, then validate it with
. If it fails, walk the user through generating an Organization-level Cloud API key and
registering it as a context (never in chat), then re-validate and report the discovered organization.
GET cloud:/api/v1/organizations"Set up cloud in the EU region" — after validating the context, list regions with
, pick an EU region (for example ), and confirm it as the default
for subsequent project creation.
GET cloud:/api/v1/serverless/regionsaws-eu-west-1"Add to my search project with read-only access" — check members with
; if Alice is new,
with a project-scoped role for the Elasticsearch
project.
alice@example.comGET cloud:/api/v1/organizations/{org_id}/membersPOST cloud:/api/v1/organizations/{org_id}/invitationsviewer"Create a 30-day CI key that can index into our search projects" — list keys with
to avoid duplicates, then with a project-scoped
role assignment including and . The secret is shown
once — never repeat it in chat.
GET cloud:/api/v1/users/auth/keysPOST cloud:/api/v1/users/auth/keysdeveloperapplication_roles: ["developer"]expiration: "30d""Give read-only access to marketing-* on my search project" — create a custom role with
(read on ), invite Bob without project roles, then assign the custom
role via on . Do not also assign .
bob@example.comPUT /_security/role/marketing-readermarketing-*application_rolesPOST cloud:/api/v1/users/{user_id}/role_assignmentsviewer"Show who has access to my organization" — and present each
member's ID, email, and roles.
GET cloud:/api/v1/organizations/{org_id}/members"配置我的云环境"——验证是否存在Cloud上下文,然后调用验证。如果验证失败,引导用户生成组织级Cloud API密钥并注册为上下文(切勿在聊天中传输密钥),然后重新验证并返回获取到的组织信息。
GET cloud:/api/v1/organizations"在欧盟区域配置云环境"——验证上下文后,调用列出区域,选择一个欧盟区域(例如),并将其设为后续项目创建的默认区域。
GET cloud:/api/v1/serverless/regionsaws-eu-west-1"将添加到我的搜索项目中,赋予只读权限"——调用检查成员;如果Alice是新用户,调用为其分配Elasticsearch项目的项目范围角色。
alice@example.comGET cloud:/api/v1/organizations/{org_id}/membersPOST cloud:/api/v1/organizations/{org_id}/invitationsviewer"创建一个有效期30天的CI密钥,可向我们的搜索项目写入数据"——调用列出密钥以避免重复,然后调用,设置项目范围的角色分配,包含和。密钥明文仅会显示一次——切勿在聊天中重复。
GET cloud:/api/v1/users/auth/keysPOST cloud:/api/v1/users/auth/keysdeveloperapplication_roles: ["developer"]expiration: "30d""赋予对我的搜索项目中索引的只读权限"——调用创建自定义角色(允许读取索引),邀请Bob时不分配项目角色,然后通过的分配自定义角色。请勿同时分配角色。
bob@example.commarketing-*PUT /_security/role/marketing-readermarketing-*POST cloud:/api/v1/users/{user_id}/role_assignmentsapplication_rolesviewer"查看我的组织有哪些用户具备访问权限"——调用并展示每个成员的ID、邮箱和角色。
GET cloud:/api/v1/organizations/{org_id}/membersGuidelines
指导原则
- Validate the Cloud context first; discover the organization ID from — do not ask for it.
GET cloud:/api/v1/organizations - Never receive, echo, or log credentials in chat. Register the Cloud API key into a CLI context so the secret goes to the OS keychain; if the user offers to paste a key, decline and point them to context registration instead. A created key's secret is shown only once — tell the user to store it securely; never repeat it.
- Default region is — only change it when the user requests a different region.
gcp-us-central1 - Confirm destructive actions (remove member, revoke key) before executing.
- Prefer predefined roles; reach for custom roles only when needed, and never stack a predefined Cloud role on the same project as a custom role.
- API key hygiene: check existing keys before creating; set an matching the task lifetime; prompt the user to revoke keys no longer needed. Each organization supports up to 500 active keys; default expiration is 3 months. Invitations expire after 72 hours by default. Cloud API keys inherit roles at creation and cannot be updated — revoke and recreate to change roles.
expiration - For creating and operating projects, traffic filters, and deployments, see cloud-provisioning; for ES-level role management see elasticsearch-authz.
- 首先验证Cloud上下文;通过获取组织ID——切勿向用户索要。
GET cloud:/api/v1/organizations - 切勿在聊天中接收、回显或记录凭证。将Cloud API密钥注册到CLI上下文,确保密钥明文存储到系统密钥链;如果用户想要粘贴密钥,请拒绝并引导其进行上下文注册。创建的密钥明文仅显示一次——告知用户安全存储;切勿重复。
- 默认区域为——仅当用户要求时才更改。
gcp-us-central1 - 执行破坏性操作(移除成员、撤销密钥)前必须确认。
- 优先使用预定义角色;仅在必要时使用自定义角色,且切勿为同一项目同时分配预定义Cloud角色和自定义角色。
- API密钥规范:创建前检查现有密钥;设置与任务生命周期匹配的;提示用户撤销不再需要的密钥。每个组织最多支持500个活跃密钥;默认有效期为3个月。邀请默认72小时后过期。Cloud API密钥在创建时继承角色,无法更新——如需更改角色需撤销并重新创建。
expiration - 如需创建和运营项目、流量过滤器及部署,请查看cloud-provisioning技能;如需ES级角色管理,请查看elasticsearch-authz技能。
Operations
操作列表
| HTTP API (shorthand) | |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| HTTP API(简写形式) | |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |