serverless framework 国内只能用腾讯云?

2021-11-09 16:55:04 +08:00
 liliclinton

最近打算在 aws 上部署 serverless 应用,看了一圈感觉 serverless framework 这个框架挺热门打算试一试,结果安装完第一次初始化就只有腾讯云的模板可以选择,看了一圈文档都没找到地方修改默认设置,怀疑是判断系统语言强制的?

然后搜了一下发现这个项目接受了腾讯云不少投资的样子,腾讯想要推广自家云服务就这么强奸用户的?

7094 次点击
所在节点    云计算
53 条回复
liliclinton
2021-11-10 12:02:08 +08:00
@zhoujinjing09 fargate 不是容器服务么
liliclinton
2021-11-10 12:05:28 +08:00
@fannas 问题是当你需要部署大量云函数和其他 aws 服务的时候,你需要一个工具帮你去批量处理和管理这些东西
Rorysky
2021-11-10 12:15:10 +08:00
来自开发者的回复:

There is no discrimination here, The logic you see here is used to auto separate users that use AWS and Tencent Provider, and for users from China Tencent is the default provider.

We decide to make Tencent as the default provider in China as we cooperate with Tencent closely to provide the best experience for most users from China, and user may easily switch back to AWS if they wish by set SERVERLESS_PLATFORM_VENDOR to aws or SLS_GEO_LOCATION to anywhere else than cn.

We need to know if a user is from China, then we will show CLI context in Chinese to make it easier for users from China use the CLI and understand help info we want to tell users.

Technically, we have have different architecture on AWS and Tencent, as the infrastructure is different, so we have different CLI (Framework CLI and Component CLI) to help user using serverless, to make user has the best experience, we nested the components CLI in the Framework CLI , they all will be triggered by commands serverless or sls, with geo location info we can easily find the correct CLI for all Serverless users.

We worked a lot to improve the experience of users from China, not only the Chinese content, but also the user scenarios that China users preferred (eg: easy deploy WEB framework app to serverless, like Express, Flask, ThinkPHP).

Hope this give you a clear idea why we check geo location and vendor info in our code, please let me know if you have future questions.
sy20030260
2021-11-10 12:47:12 +08:00
CLI init 也只是创建了个 yaml ,从官网的 example copy 一个下来就行
seducer0719
2021-11-10 12:56:09 +08:00
lz 需要的应该是这个,aws sam (Serverless Application Model) cli
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html
通过一个 yaml 文件管理所有的 lambda 资源,还有 lambda layer 也可以
CodeBase
2021-11-10 13:44:11 +08:00
可以试试阿里云的云开发平台
https://workbench.aliyun.com/
liliclinton
2021-11-10 14:18:24 +08:00
@seducer0719 看起来不错,我试试
aliveyang
2021-11-10 16:44:33 +08:00
什么东西到国内就变味了
chenxiaohong
2021-11-11 11:22:20 +08:00
国内合作伙伴,腾讯云
国外合作伙伴,AWS
Txyhwkj
2021-11-13 09:46:11 +08:00
借个楼蹭个帖,腾讯云钻石代理,所有价格都比官网便宜,续费 5000 以上最高可享 6 折 5 折(不限新老用户),合作现返 25%,祝各位生活愉快 打扰了 更多优惠可以联系 Tengxunyun-Cc
ole3021
2021-11-16 14:50:34 +08:00
大家好, 我是 Serverless 的高级产品经理 Oliver

感谢大家对于 serverless 的热情, 我这里统一回复一下相关的问题,并解释一下我们之所以这么做的原因。

1. 为什么要用 Serverless 而不直接使用 AWS SAM 或 AWS Fargate?

Serverless 致力于提供跨云厂商的无服务器开发体验,我们最终的目标是让开发者无需关心云厂商的不同,以及无需配置应用集成部署流程,只需关心应用开发和用户增长。
(目前在现阶段我们在平衡了用户使用体验与跨运厂商的功能需求后,目前重心主要在用户的使用体验,相关跨云平台的功能我们也在逐步完善)

同时 Serverless 提供了一整套完成的 Serverless 应用开发、集成、监控、管理的产品和相关工具。例如
* Serverless CLI 提供了用户使用本地编辑器,工具开发、调试、管理 Serverless 应用的功能。
* Serverless CI/CD 提供了 Serverless 应用的自动集成,预览发布,部署管理等功能。
* Serverless Secrets 提供了 Serverless 应用的密钥信息集成,管理功能。
* Serverless Console(控制台) 提供了团队账号协同管理,Serverless 应用日志分析,异常报警等功能。
* Serverless Cloud 提供了秒级的 Serverless 应用开发云平台,同时更加轻松的查看和分享您的 Serverless 应用。
(以上部分功能处于开发预览阶段,如需体验请前往 Serverless 全球站点了解体验。)

2. 为什么我被“绑定”在腾讯云,以及自动重定向到中文官网?

我们并没有“绑定”所有的中国用户在腾讯云上,而是出于使用方便,默认将腾讯云作为为中国用户的提供 Serverless 服务的云厂商。用户依旧可以通过环境变量`SERVERLESS_PLATFORM_VENDOR=aws `来选择使用 AWS 。

之所以这么做,是因为因为网络限制等原因,中国用户无法完整体验到 AWS 的功能,并且国内 AWS 用户数量非常少,从统计数据上大家更倾向于国内的云服务厂商,如阿里云和腾讯云。

因为中国和全球用户提供的 Serverless 方案以及用法上的不同,以及我们需要使用中文来更好的帮助中国开发者理解使用 Serverless 工具,所以我们有专门构建 Serverless 中文官网。同时因为历史原因,中文官网与 全球官网都使用 www.serverless.com 所以我们才有的基于 IP 地址的自动重定向。

目前已经将中文官方 迁移至 cn.serverless.com , 但是为了对老用户的兼容,所以依旧保持了 www.serverless.com 的 IP 自动重定向。 (可以通过 wb.serverless.com 来访问英文的全球官网, 再中文官网底部的交流社区下也提供了跳转链接)

3. Serverless Framework (基于 AWS 的 serverless 解决方案)与 Tencent Serverless 是两套东西?

首先要说明 无服务器开发 是一个一种按需提供后端服务的方法。无服务器提供者允许用户编写和部署代码,而不必担心底层基础设施。从无服务器提供商获得后端服务的公司将根据计算量来付费,由于这种服务是自动扩展的,不必预留和付费购买固定数量的带宽或服务器。

而 Serverless Inc 是一家专注于提供开源无服务器开发解决方案的公司,我们提供了业界知名的 Serverless Framework 并且同众多云厂商进行了合作,包括 AWS ,CloudFlare , 腾讯云,并一起为广大开发者提供最佳的无服务器开发体验工具和产品。

在腾讯云上,腾讯云有着众多的无服务器开发 产品,而目前 Serverless 主要同腾讯云一起提供了基于 Serverless Tencent ( CLI 命令行工具)和 Serverless 组件应用 ( Serverless Components )的 Serverless 开发体验。

4. Serverless 与 腾讯云是什么关系?

Serverless 与 腾讯云是战略合作伙伴的关系,Serverless 同 腾讯云一起通过深度定制的云厂商基础服务设施,解决了 Serverless 产品功能上面的许多局限性,比如对传统 WEB 框架( Express, django, Spring )应用的支持, 并可以更好的集成进腾讯云现有的云控制中心进行统一管理。 我们希望通过与腾讯云厂商的深度合作,来为用户带来超越 其他云厂商的 Serverless 应用开发体验。

5. Serverless 相关功能没有询问用户,直接绕过用户,这不是**吗?

并不是我们不询问用户,而是我们希望可以减少对用户开发的干扰,让用户可以正专注在开发和业务增长上,而不是去配置各种复杂的环境。 我们希望可以通过尽可能的自动的方式来帮助绝大多数用户解决这类困扰。

不过我们目前也意识到有许多来自中国的用户想要使用 AWS 架构来开发 Serverless 应用,因此我们也在进行一系列的改进来支持这些用户,但因为开发人员和工作安排的关系,相关功能可能要到年底或明年年初发布上线。 以下是我们再做的相关功能:

* www.serverless.com 网站提供显示的中英文站点切换提示,并允记录用户的选择倾向。
* Serverless CLI 除了现有的环境变量 还会提供更方便的永久切换方式,方便用户固定使用某一个云厂商作为 Serverless 应用的基础服务供应商。

同时我们也会在未来的产品开发过程中更加注意对于不同用户的使用体验的完善。

欢迎大家反馈 Serverless 使用问题,以及提出改进建议, 我们会认真对待每位用户的反馈,并为中国用户带来最好的 无服务器应用开发体验。

欢迎大家到我们的 Serverless 中文讨论区 ( https://github.com/serverless/serverless-tencent/discussions )与我们进行沟通。
ahill
2022-07-08 16:31:27 +08:00
serverless create --template aws-python3 不指定默认是腾讯
fannas
2022-09-06 22:28:14 +08:00
@liliclinton 所以 aws 有 cloud formation

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/814196

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX