开发者社区 > 云原生 > Serverless > 正文

阿里函数计算中s.yaml的必填项目有哪些?

阿里函数计算中s.yaml的必填项目有哪些?

展开
收起
土豆吃小鸡 2024-08-09 22:08:20 12 0
2 条回答
写回答
取消 提交回答
  • 地域,名字,代码位置,内存,超时时间
    next_function:
    component: fc3
    props:
    region: ${vars.region}
    functionName: next_function_example
    description: 'hello world by serverless devs'
    runtime: "custom-container"
    codeUri: ./code/target
    handler: main
    memorySize: 128
    timeout: 60此回答整理自钉群“阿里函数计算客户”。

    2024-08-13 11:59:02
    赞同 展开评论 打赏
  • 参考如下配置文件:

    edition: 1.0.0
    name: hello-world-app
    access: default
    
    vars: # 全局变量
      region: "cn-hangzhou"
      service:
        name: "hello-world-service"
        description: 'hello world by serverless devs'
        tracingConfig: Enable # 开启链路追踪功能
    
    services:
      helloworld: # 业务名称/模块名称
        component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
        props:
          region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
          service: ${vars.service}
          function:
            name: "start-fc-event-python3"
            description: 'hello world by serverless devs'
            runtime: python3.9
            codeUri: ./code
            handler: index.handler
            memorySize: 128
            timeout: 60
    

    ——参考链接

    2024-08-10 07:54:09
    赞同 5 展开评论 打赏

快速交付实现商业价值。

相关产品

  • 函数计算
  • 相关电子书

    更多
    Hologres Serverless之路:揭秘弹性计算组 立即下载
    Serverless开发平台: 让研发效能再提升 立即下载
    Serverless 引领云上研发新范式 立即下载