Search code examples
amazon-web-servicesaws-cloudformationaws-opsworks

Assign the Recipes to LifeCycle Events in Opsworks by Cloudformation


In the opsworks console, in the layer page, we can configure the Custom Chef Recipes for the lifecycle events of the stack. (Here).

I am creating a cloudformation template that creates all the opsworks stack, layers, instances and apps and I need to specify these receipes too in the template. Is that possible? Thank you.


Solution

  • It is possible simply by using the CustomRecipes property in the AWS::OpsWorks::Layer resource:

    "CustomRecipes" : {
               "Setup"     : ["cookbook1::setup","cookbook2::setup"],
               "Configure" : ["settings::default"],
               "Deploy": ["application12::deploy"]
            },