Skip to content

fc-sandbox 组件的 Yaml 完整示例

  1. 如果您使用 VsCode 开发,推荐您配置智能提示和检测

  2. 字段含义参见 fc-sandbox Yaml 规范文档

最小示例

只声明一个 Team,不带存储卷与密钥:

edition: 3.0.0 #  命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: hello-sandbox #  项目名称
access: default #  秘钥别名

resources:
  sandbox:
    component: fc-sandbox
    props:
      region: cn-hangzhou
      teamName: dev
      description: dev team

完整示例

edition: 3.0.0
name: hello-sandbox
access: default

resources:
  sandbox:
    component: fc-sandbox
    props:
      region: cn-hangzhou # cn-hangzhou | cn-shanghai | cn-beijing | cn-shenzhen | cn-hongkong | ap-southeast-1 | us-west-1 | us-east-1
      teamName: dev # 身份键,改名等价于新建资源
      description: dev team
      plan: base
      # resourceGroupID: rg-xxx
      # endpoint: <自定义 endpoint,为空时按 region 推导>

      volumes:
        # OSS 类型存储卷
        - volumeName: data # Team 内身份键
          # status 是 volume 唯一可更新的字段
          # status: active
          ossVolumeConfig:
            bucketName: my-bkt
            bucketPath: /data
            endpoint: oss-cn-hangzhou.aliyuncs.com
            readOnly: false

        # AgenticFS 类型存储卷
        - volumeName: shared
          agenticFSVolumeConfig:
            serverAddr: 1.2.3.4:2049
            userID: 0
            groupID: 0

      apiKeys:
        - apiKeyName: ci # Team 内身份键
          expireTime: '2027-01-01T00:00:00Z' # RFC3339
          # status: active
          ipWhitelist:
            - ipAddress: 1.2.3.0/24
              description: office
            - ipAddress: 4.5.6.7
              description: ci runner

        - apiKeyName: readonly
          ipBlacklist:
            - ipAddress: 10.0.0.0/8
              description: internal only

⚠️ 注意:

  • apiKeyValue(密钥明文)不是声明字段,写在 s.yaml 里无效。它由服务端生成,需要取回时用 apikey get,参见约束二
  • Volume 的 ossVolumeConfig / agenticFSVolumeConfig 创建后不可修改,改了只会 warn 并跳过,参见 Yaml 规范中的约束
  • 资源配额(Quota)是账号 / tag 级别的资源,不在 s.yaml 中声明,只能通过 quota 命令 管理。

快速开始

# 1. 验证凭证与地域
s cli fc-sandbox team list --region cn-hangzhou -a default

# 2. 查看本次部署会做哪些变更
s plan

# 3. 部署
s deploy

# 4. 查看线上状态
s info