AWS CloudFormation - 如何上传一些 python/flask 代码
我编写了一个 python/flask 代码,并将其成功上传到 EBS(弹性豆茎)环境,一切正常。我还编写了一个 yaml 脚本来创建一个 cloudformation (CF) 堆栈,该堆栈成功启动了带有目标组的自定义 VPC/子网/安全组/应用程序负载均衡器以及带有 EC2 实例的自动缩放组。现在,我想在上面的 CF 堆栈中上传我的 Python/Flask 代码,以便它的工作方式与 EBS 应用程序完全相同。
您能指出我正确的方向吗?
先感谢您。
附言。我没有包含 CF 模板,因为它有 300 多行长。我不需要任何人真正为我解决问题。只需将其推向正确的方向即可。
I have writen a python/flask code which I succesfully uploaded to an EBS (elastic beanstalk) enviroment and everything works fine. I have also written a yaml script creating a cloudformation (CF) stack which succesfully launches a custom VPC/subnets/security group/application load balancer with target group and autoscaling group with EC2 instances. Now, I would like to upload my Python/Flask code in the above CF stack so it works exactly like the EBS application.
Would you please point me in the right direction?
Thank you in advance.
PS. I have not included the CF template since it is over 300 lines long. I dont need anybody to actually solve the problem for me. Just a nudge it the correct direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅 AWS ::Lambda::Function.Code 和 代码定义
您可以点它@ S3 中的 zip 文件,或者如果不是太长,请将其嵌入到模板中(请参阅压缩文件)
See AWS::Lambda::Function.Code and Code Definitions
You can either point it @ a zip file in S3 or if not too long, embed it in the template (see ZipFile)
正确的方法是使用 AWS CodePipeline 创建 CI/CD 管道。它与 ElasticBeanstalk 和甚至使用 CloudFormation 来允许自动部署新的 EB 应用程序版本和/或 CF 堆栈。
The proper way is to create a CI/CD pipeline using AWS CodePipeline. It integrates natively with ElasticBeanstalk and even with CloudFormation to allow for automated deployments of new EB application versions and/or CF stacks.