简体   繁体   中英

aws-cli equivalent of eb deploy?

I'm attempting to deploy an app from one ElasticBeanstalk instance to another. Running pip install awsebcli --upgrade --user doesnt install the eb cli tool for some odd reason on the EC2 machine.

Does anyone know the equivalent of eb deploy using only the aws cli options?

This question is a bit confusing. Are you attempting to move code between EC2 instances in your Beanstalk environment?

If I'm assuming correctly, you've pulled/changed your code on one Beanstalk host. And now you're trying to propagate that change to the other instances using the EB CLI. That's not a best practice. Beanstalk has a mechanism to deploy your code to all instances.

The EB CLI is meant to be run from your workstation to push code from your IDE/editor to the Beanstalk hosts in AWS.

Beanstalk keeps a copy of that code revision in S3. And if the Beanstalk environment is load balanced then all instances will be running the same application version when scaling events or deployments occur because it will pull your code from a common source.

But to answer your question:

Does anyone know the equivalent of eb deploy using only the aws cli options?

You're gonna wanna ZIP and upload your code to S3 and note the S3 key and bucket values of where it's located.

Then create a new application version.

% aws elasticbeanstalk create-application-version --application-name="<APPLICATION_NAME>" --version-label="<NEW_VERSION_LABEL>" --source-bundle="{\"S3Bucket\": \"<S3_BUCKET_NAME>\",\"S3Key\": \"<S3_KEY>\"}"

Then deploy your new application version to the running environment.

% aws elasticbeanstalk update-environment --environment-id="<ENVIRONMENT_ID>" --version-label="<NEW_VERSION_LABEL>"

Reading is hard...

Linux requires you to "[a]dd the path to the executable file to your PATH variable"

export PATH=~/.local/bin:$PATH

eb --version now works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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