I am trying to pass custom json to an opsworks layer. This is possible manually in the web interface but I cannot find anything regarding this in the Cloud Formation documentation (AWS CloudFormation). Has anybody done this or have a work around? I don’t really want to have to create a new stack for every layer.
I opened a ticket with aws for this very reason last week. It is not possible. It has already been noted as a feature request although they couldn’t give any sort of timeline.
Their advice was to put it at the stack level and put some intelligence in the recipe. I haven’t come up with a workaround yet.
I came up with a workaround but boy is it complex.
I defined a custom resource that I called “Custom::OpsWorksLayer” that calls a lambda function and passes it all I want (Custom JSON and other things that CFN does not have built-in right now), and this lambda function uses the SDK to create/update/destroy the layer as needed.