# Cloudformation passing "CustomJSON" to a layer..

**URL:** <https://awshq.com/t/cloudformation-passing-customjson-to-a-layer/1447>\
**Category:** Architecture & IaC\
**Tags:** cloudformation\
**Created:** [February 1, 2016, 11:08am UTC](https://awshq.com/t/cloudformation-passing-customjson-to-a-layer/1447 "2016-02-01T11:08:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uncleguru](https://awshq.com/letter_avatar_proxy/v4/letter/u/bcef8e/32.png) [@uncleguru](https://awshq.com/u/uncleguru)\
**Post date:** [February 1, 2016, 11:08am UTC](https://awshq.com/t/cloudformation-passing-customjson-to-a-layer/1447/1 "2016-02-01T11:08:26Z")

</div>

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](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html)). Has anybody done this or have a work around? I don’t really want to have to create a new stack for every layer.

* * *

**Related discussions:**

- [Cognito Managed Login](https://awshq.com/t/cognito-managed-login/20041)
- [How do I “export” my manually configure infrastructure into IaC](https://awshq.com/t/how-do-i-export-my-manually-configure-infrastructure-into-iac/20262)
- [AWS CloudFormation Diagrams (2026-01-02)](https://awshq.com/t/aws-cloudformation-diagrams-2026-01-02/20942)
- [Am I the only one who builds in the Console first, then reverse engineers the IaC?](https://awshq.com/t/am-i-the-only-one-who-builds-in-the-console-first-then-reverse-engineers-the-iac/20870)
- [Deploying and managing Lambdas - CDK, Terraform, or SAM?](https://awshq.com/t/deploying-and-managing-lambdas-cdk-terraform-or-sam/19614)

---

<div class="post-metadata">

**Author:** ![uncleguru](https://awshq.com/letter_avatar_proxy/v4/letter/u/bcef8e/32.png) [@uncleguru](https://awshq.com/u/uncleguru)\
**Post date:** [February 1, 2016, 11:27am UTC](https://awshq.com/t/cloudformation-passing-customjson-to-a-layer/1447/2 "2016-02-01T11:27:08Z")

</div>

I am having the same issue passing custom cookbooks. I guess that Cloud Formation must not be compatible with Opsworks 12 …

---

<div class="post-metadata">

**Author:** ![bankulin](https://awshq.com/letter_avatar_proxy/v4/letter/b/7c8e57/32.png) [@bankulin](https://awshq.com/u/bankulin)\
**Post date:** [February 1, 2016, 10:56pm UTC](https://awshq.com/t/cloudformation-passing-customjson-to-a-layer/1447/3 "2016-02-01T22:56:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Esiria](https://awshq.com/letter_avatar_proxy/v4/letter/e/3bc359/32.png) [@Esiria](https://awshq.com/u/Esiria)\
**Post date:** [April 27, 2016, 11:12pm UTC](https://awshq.com/t/cloudformation-passing-customjson-to-a-layer/1447/4 "2016-04-27T23:12:28Z")

</div>

> [@bankulin](#):
>
> 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 …

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.
