Peter M
Peter M

Reputation: 1149

opsworks: 'update custom cookbooks' from command line

Is there a way to update custom cookbooks from the command line on an opsworks instance?

I don't see a way to do it with the AWS OpsWorks Agent CLI or with the AWS Command Line Interface.

The only way I am able to do it is through the console.

Thanks!

Upvotes: 3

Views: 1062

Answers (4)

talarczykco
talarczykco

Reputation: 523

I find that --app-id isn't strictly necessary to create a deployment, and adding a wait is helpful:

aws opsworks wait deployment-successful --deployment-id $(
  aws opsworks create-deployment \
    --output text \
    --stack-id $STACK_ID \
    --command "{\"Name\":\"update_custom_cookbooks\"}"
)

Upvotes: 1

Prabuddha Chakraborty
Prabuddha Chakraborty

Reputation: 528

  1. Make sure .aws/config (default) is set

  2. aws opsworks --region us-east-1 create-deployment --stack-id $STACK_ID --app-id $APP_ID --command "{\"Name\":\"update_custom_cookbooks\"}"

    or

    aws opsworks --region us-east-1 create-deployment --stack-id $STACK_ID --app-id $APP_ID --command "{\"Name\":\"deploy\"}"

    Replace $STACK_ID and $APP_ID and --region with respective to your application.

Upvotes: 4

dcbaok
dcbaok

Reputation: 81

This seems to be possible using the create-deployment command.

http://docs.aws.amazon.com/cli/latest/reference/opsworks/create-deployment.html

Note: Haven't done this myself, currently working on it though!

Upvotes: 7

coderanger
coderanger

Reputation: 54211

OpsWorks only has the config for where to get your cookbooks from, as your link clearly states. To update the content, you do it yourself. Either update the git repo, or upload a new ZIP bundle to whichever HTTP server you are using (usually S3).

Upvotes: 0

Related Questions