简体   繁体   English

查看 AWS 中的应用程序设置

[英]Review application setup in AWS

I am looking for pointers in the right direction with AWS.我正在使用 AWS 寻找正确方向的指针。 Previously I have worked with Heroku, which allows users to create review applications of each pull request you create in Github.以前我使用过 Heroku,它允许用户为您在 Github 中创建的每个拉取请求创建审查应用程序。 This has been a wonderful feature as it allows you to create separate environments (Database, Compute Instance / Lambda, URL) to preview the changes.这是一个很棒的功能,因为它允许您创建单独的环境(数据库、计算实例/Lambda、URL)来预览更改。 You can ask users to test the feature they've requested via an unique URL such as https://my-test-app-123.domain.com您可以要求用户通过独特的 URL 测试他们请求的功能,例如https://my-test-app-123.domain.com

I am looking for a similar solution using AWS.我正在寻找使用 AWS 的类似解决方案。 I am wondering if there is already such a service I am not aware of.我想知道是否已经有我不知道的这种服务。 I have taken a look at Elastic Beanstalk but I am unsure how to configure it to be aware of all the pull requests I have made in Github.我查看了 Elastic Beanstalk,但我不确定如何配置它以了解我在 Github 中提出的所有拉取请求。

The ideal setup would be:理想的设置是:

Three environments: Review apps (based on branches), QA (based on master branch), Production (based on manual promotion from QA).三种环境:审查应用程序(基于分支)、QA(基于master分支)、生产(基于 QA 的手动提升)。
- For each pull request, create unique instances of: S3, DynamoDB, Lambda, API Gateway (for unique URL). - 对于每个拉取请求,创建以下唯一实例:S3、DynamoDB、Lambda、API 网关(用于唯一 URL)。 Run tests against this PR environment.针对这个 PR 环境运行测试。 Environment variables for review applications should be copied from QA apart from those pointing to newly created support services such as S3, DynamoDB.除了指向新创建的支持服务(如 S3、DynamoDB)的环境变量外,应从 QA 复制审查应用程序的环境变量。
- Whenever there is a commit to master branch, have QA environment update itself to match whatever is in master branch. - 每当提交到master分支时,让 QA 环境自行更新以匹配 master 分支中的任何内容。
- Have a possibility to trigger promotion from QA to Production manually. - 有可能手动触发从 QA 到生产的升级。

Which service(s) should I be looking at?我应该查看哪些服务? CloudFormation sounds like the right bet but it is very complicated I am not sure where to start. CloudFormation 听起来像是正确的选择,但它非常复杂,我不知道从哪里开始。

I will not have answers for all your requirements, but if you ask about a start, I think the following could be worth considering.我不会为您的所有要求提供答案,但如果您询问开始,我认为以下内容可能值得考虑。

  1. Have a CodePipeline with a source action set to GitHub.源操作设置为 GitHub 的 CodePipeline。

  2. CodePipeline can deploy resources by means of CloudFormation. CodePipeline 可以通过 CloudFormation 部署资源 This would produce unique set of the resources you need.这将产生您需要的一组独特的资源。 There are limits on their number, so can't create hundrets for them for each commit.它们的数量有限制,因此不能为每次提交创建数百个。

  3. CodePipepline also supports Lambda invocation actions and manual approvals, for example to deploy to production. CodePipeline 还支持 Lambda 调用操作和手动批准,例如部署到生产。 For most complex cases you can design your own custom actions with tailored made job workers for the CodePipeline.对于大多数复杂的情况,您可以使用为 CodePipeline 量身定制的工作人员来设计自己的自定义操作。

CloudFormation is not perfect by worth spending time learning it. CloudFormation 并不完美,值得花时间学习它。

Hope that this helps you get started.希望这可以帮助您入门。 If you want to create different set of resources for each PR/commit, then I would suggest starting with writing a CloudFormation template to deploy a single set of resources you require.如果您想为每个 PR/提交创建不同的资源集,那么我建议从编写 CloudFormation 模板开始部署您需要的单个资源集。 Then parametrize it so that you can make multiple sets of resources from the same template.然后对其进行参数化,以便您可以从同一模板制作多组资源。 When parametrized, can think of how to plug it into CodePipeline to create the resources based on your GitHub changes.参数化后,可以考虑如何将其插入 CodePipeline 以根据您的 GitHub 更改创建资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM