如何创建与Elastic Beanstalk匹配的Vagrantfile? [英] How to create a Vagrantfile that matches Elastic Beanstalk?

查看:51
本文介绍了如何创建与Elastic Beanstalk匹配的Vagrantfile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在整理一个计划部署到Elastic Beanstalk的PHP网站,我想创建一个虚拟化的开发环境来匹配生产.我对此有一些疑问.

因此,看来我可以使用 vagrant-aws 并为其提供自定义AMI-大概是一个由Beanstalk创建的.但是,这实际上会起作用吗?似乎它使用rsync来复制任何新文件.等待开发同步时,这会减慢开发速度吗?

更重要的是,如果要进行任何开发,似乎这依赖于网络连接.是否可以使其离线,这样我就可以在没有连接的情况下进行开发(例如在飞机上,在公共汽车上等)?

作为替代方案,是否有人将与Elastic Beanstalk的软件包和设置匹配的Vagrantfile放在一起?我在搜索中找不到任何东西,但是也许我在找错地方了?

最后,对于进行这种开发测试有什么建议吗?我是在考虑正确的方法,还是有更好的方法来做到这一点?

解决方案

我想说,最干净的方法是使用可以交给自定义AMI a>,并且如果您的开发人员已下载了无业游民"框,则在断开连接后即可正常工作.

这不是最简单的选择,因为您必须自己配置映像上的所有程序包,但这是使开发箱与生产箱保持同步的好方法.

We're putting together a PHP site that we plan on deploying to Elastic Beanstalk, and I'd like to create a virtualized dev environment to match production. I've got a few questions about it, though.

So it looks like I can use vagrant-aws and feed it a custom AMI - presumably one that would be created by Beanstalk. Will this actually work, though? It seems like it uses rsync to copy any new files up. Is that going to slow down development as I wait for it to sync up?

More importantly, it seems like this relies on a network connection if you want to do any development. Is it possible to take it offline so I can develop without a connection (e.g. on a plane, on a bus, etc.)?

As an alternative, has anyone put together a Vagrantfile that matches the packages and setup of Elastic Beanstalk? I couldn't find anything in my searches, but maybe I was looking in the wrong spot?

Finally, are there any recommendations for pulling off this sort of dev testing? Am I thinking about this the right way, or is there a better way to do this?

解决方案

I'd say that the cleanest way is to use a tool like Packer to create an image for both EC2 and Vagrant. That way you control the image you're using and you know it's the same for both EC2 and Vagrant.

Elastic Beanstalk can be handed a custom AMI and if your devs have the vagrant box downloaded they can work when disconnected.

It's not the easiest option since you have to configure all the packages on the image yourself but it's a good way to keep your dev boxes and production boxes in sync.

这篇关于如何创建与Elastic Beanstalk匹配的Vagrantfile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆