aws中部署防火墙
Recently, Apple announced the Swift AWS Lambda Runtime. It’s now possible to write self-contained functions that run on AWS using the same Swift you use for iOS development. This not only lets you reuse the knowledge you already have of Swift, but also share code between the server and client.
苹果最近宣布了Swift AWS Lambda Runtime 。 现在,可以使用与iOS开发相同的Swift编写可在AWS上运行的独立功能。 这不仅使您可以重用已有的Swift知识,而且还可以在服务器和客户端之间共享代码。
However, everything is still a little bit complicated to set up. To help you get started faster, I built a starting point for writing an HTTP service in Swift, which does everything you need in a single script.
但是,一切设置仍然有些复杂。 为了帮助您更快地入门,我建立了一个在Swift中编写HTTP服务的起点 ,该服务可以在一个脚本中完成所有您需要的工作。

Swift Lambda contains configuration files and scripts to fully automate deploying to AWS in a matter of seconds using the Serverless Framework. It’s based on samples and documentation from swift-server/swift-aws-lambda-runtime.
Swift Lambda包含配置文件和脚本,可使用无服务器框架在几秒钟内完全自动化部署到AWS。 它基于swift-server / swift-aws-lambda-runtime的示例和文档。
入门 (Getting Started)
Clone the repository: https://github.com/GetStream/swift-lambda
克隆存储库: https : //github.com/GetStream/swift-lambda
Write your code in
Sources/Lambda/main.swift
在
Sources/Lambda/main.swift
编写代码Deploy by running
./Scripts/deploy.sh
通过运行
./Scripts/deploy.sh
部署- Open the output URL in your browser: 在浏览器中打开输出URL:

编写代码 (Writing Code)
There is some code already present in the Sources/Lambda/main.swift
file. It simply outputs "Hello, world!" in plain text.
Sources/Lambda/main.swift
文件中已经存在一些代码。 它只是输出“你好,世界!” 以纯文本格式。
If you want to output some HTML, just set the Content-Type
header to text/html; charset=UTF-8
:
如果要输出一些HTML,只需将Content-Type
标头设置为text/html; charset=UTF-8
text/html; charset=UTF-8
:

For more information on the available settings and methods, refer to the Swift AWS Lambda Runtime README.
有关可用设置和方法的更多信息,请参阅Swift AWS Lambda Runtime README 。
配置端点 (Configuring the Endpoint)
To change some characteristics of your HTTP endpoint, such as the method expected, you should modify the serverless.yml
file. For more information on the available parameters, refer to the Serverless.yml Reference
要更改HTTP端点的某些特征(例如预期的方法),应修改serverless.yml
文件。 有关可用参数的更多信息,请参阅Serverless.yml参考。
贡献 (Contributing)
If you have a suggestion or bug report, please file an issue in the Swift Lambda repository. If you want to take a stab at contributing code, don’t hesitate in submitting a PR. Don’t forget to leave a star if you liked it!
如果您有建议或错误报告,请在Swift Lambda存储库中提交问题 。 如果您想贡献代码,请不要犹豫,提交PR。 如果喜欢,别忘了留下一颗星星!
aws中部署防火墙