Question

I've deployed a stack in Amazon OpsWorks, and I extensively use custom cookbooks to deploy my application. I have a number of instances in my stack that are load-based (they only boot up when needed).

Anytime I make changes to my custom cookbooks, I have to manually update the cookbooks on any running instances (by navigating to Deployments > Run Command). The problem is that any non-booted instances are not updated, and they don't automatically update at their next boot.

I've figured out that I can delete and then recreate all my load-based instances, forcing them to be completely re-setup when they're next needed, but there must be a better way to deploy updated custom cookbooks.

How can I force my offline load-based instances to update their cookbooks at the next boot (even every boot would be fine)?

Was it helpful?

Solution

From this AWS employee response on an Amazon Opsworks forum:

There isn't a way to push updates to stopped instances. We're considering ways to enable this. For now, if you create a new time or load based instance, it will get your updates.

So it would appear that for now, the only way to do what you'd like to do is to delete and recreate each of your load-based instances. This should ensure that the first time they boot up, they receive fresh versions of your custom cookbooks.

OTHER TIPS

You can run Update Custom Cookbooks command from Stack, Run Command window.

As it says: http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-installingcustom-enable-update.html

enter image description here

According to the opsworks documentation:

http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-installingcustom-enable-update-.html

To manually update custom cookbooks

Update your repository with the modified cookbooks. AWS OpsWorks uses the cache URL that you provided when you originally installed the cookbooks, so the cookbook root file name, repository location, and access rights should not change.

For Amazon S3 or HTTP repositories, replace the original .zip file with a new .zip file that has the same name.

For Git or Subversion repositories, edit your stack settings to change the Branch/Revision field to the new version.

On the stack's page, click Run command and select the update custom cookbooks command.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top