# Custom USERDATA via Elastic CI Stack

**URL:** <https://forum.buildkite.community/t/custom-userdata-via-elastic-ci-stack/3281>\
**Category:** Elastic CI Stack for AWS\
**Created:** [October 5, 2023, 1:39am UTC](https://forum.buildkite.community/t/custom-userdata-via-elastic-ci-stack/3281 "2023-10-05T01:39:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mic](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@Mic](https://forum.buildkite.community/u/Mic)\
**Post date:** [October 5, 2023, 1:39am UTC](https://forum.buildkite.community/t/custom-userdata-via-elastic-ci-stack/3281/1 "2023-10-05T01:39:56Z")

</div>

Hi Buildkite,

We have 4+ queues being used, and the whole stack is deployed with terraform(using the AMI’s published as part of the Elastic CI stack).

Now, we got a bit stuck in time as the changes to the AMI, scripts to configure the agent have been updated, and our cloudwatch logs streams are taking more and more work to reconfigure. :D

I’m thinking to deploy the cloudformation stack via terraform resource: [https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation\_stack](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack)  
It’ll be used to deploy the stack with several sets of configuration… 1 stack/queue.

Some questions before I start this effort:

- is there a supported way to inject our own additional USERDATA? we want to add EFS for the git mirror, install additional security tooling, ssh-keys from our vault, pre download some docker images(as a cache)

- is this the cloudformation template: [https://github.com/buildkite/elastic-ci-stack-for-aws/blob/main/templates/aws-stack.yml](https://github.com/buildkite/elastic-ci-stack-for-aws/blob/main/templates/aws-stack.yml)

Any advice/warnings/thoughts appreciated.

Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![james.s](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/james.s/32/1305_2.png) [@james.s](https://forum.buildkite.community/u/james.s)\
**Post date:** [October 5, 2023, 2:13am UTC](https://forum.buildkite.community/t/custom-userdata-via-elastic-ci-stack/3281/2 "2023-10-05T02:13:27Z")

</div>

Hey @Mic!

Hope you’re well, and thanks for the questions! 👋

For 1) - I’d direct attention to setting this through a `BootstrapScriptUrl` (parameter in the CI stack’s template) - which you could then use to set additional meta-data on.

1. That certainly is the template - be sure to switch to the tag version of the specific version of the CI Stack that you are using (as main might not always point to a released version!)

Cheers!
