如何将AWS CLI与Elastic Beanstalk结合使用? [英] How to use AWS CLI with Elastic Beanstalk?

查看:78
本文介绍了如何将AWS CLI与Elastic Beanstalk结合使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在文档中指出EB CLI被AWS CLI取代,但是所有文档仍在谈论EB CLI.

In the documentation it states that the EB CLI is replaced by AWS CLI but all of the documentation is still talking about EB CLI.

我已经在Elastic Beanstalk控制台中创建了一个应用程序,现在我准备开始开发.我已经在Ubuntu上安装了所有工具,并且已经在本地对其进行了测试.现在,我想将其部署到Elastic Beanstalk.如何使用AWS CLI做到这一点?

I have created an application in Elastic Beanstalk console and now I'm ready to start developing. I have all the tools installed on Ubuntu and I've already tested it locally. Now I want to deploy it to Elastic Beanstalk. How do I do this with AWS CLI?

推荐答案

您必须从应用程序创建源包,请在此处查看详细信息: AWS CodeCommit

You have to create a source bundle from your application, see details here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html (Or alternatively you can use AWS CodeCommit or AWS CodeBuild as source for your application.)

然后,您可以使用AWS CLI从您的应用程序创建一个新版本并将其部署到一个应用程序环境中. (请参见此处.)

Then you can use the AWS CLI to create a new version from your application and deploy it to one application environment. (See the CLI documentation for EBS here.)

创建源包:

zip MyCodeBundle.zip <source files>

将其上传到S3:

aws s3 cp MyCodeBundle.zip s3://a-bucket-where-you-store-your-source-bundles/

创建新的应用程序版本使用您刚刚上传的源包:

Create a new application version using the source bundle you just uploaded:

aws elasticbeanstalk create-application-version --application-name YourEBSAppName --version-label YourVersionLabel --source-bundle S3Bucket="a-bucket-where-you-store-your-source-bundles",S3Key="MyCodeBundle.zip"

最后,您更新您的环境之一使用该版本(这是 deploy ,即使新的

And finally you update one of your environments to use that version (this is deploy even though that verb is completely missing from the new AWS CLI for EBS - this was a little confusing for me):

aws elasticbeanstalk update-environment --application-name YourEBSAppName --environment-name YourEBSEnvironmentName --version-label YourVersionLabel

这篇关于如何将AWS CLI与Elastic Beanstalk结合使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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