# What's in your userdata.sh?

**URL:** <https://awshq.com/t/whats-in-your-userdata-sh/2741>\
**Category:** AWS Cloud Talk\
**Created:** [December 12, 2016, 7:07pm UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741 "2016-12-12T19:07:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![turboOrc](https://awshq.com/letter_avatar_proxy/v4/letter/t/9fc348/32.png) [@turboOrc](https://awshq.com/u/turboOrc)\
**Post date:** [December 12, 2016, 7:07pm UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/1 "2016-12-12T19:07:38Z")

</div>

Do most folks use a userdata.sh script when they spawn a new instance, and if so what’s in yours?

* * *

**Related discussions:**

- [AWS customer since 2017 — reinstatement denied after submitting verification documents, important data inaccessible](https://awshq.com/t/aws-customer-since-2017-reinstatement-denied-after-submitting-verification-documents-important-data-inaccessible/21748)
- [Support?](https://awshq.com/t/support/21670)
- [The Evolution of AI from Assistant to Decision-Maker#EvolutionOfAI #ArtificialIntelligence #AIAgents #DecisionMakingAI #AgenticAI #AIRevolution #MachineLearning #DeepLearning #GenerativeAI #AutonomousAI #IntelligentAutomation #AIInnovation #FutureOfAI #AITechnology #SmartSystems #CloudComputing](https://awshq.com/t/the-evolution-of-ai-from-assistant-to-decision-maker-evolutionofai-artificialintelligence-aiagents-decisionmakingai-agenticai-airevolution-machinelearning-deeplearning-generativeai-autonomousai-intelligentautomation-aiinnovation-futureofai-aitechnology-sm/21737)
- [Amazon Quick is now AWS Quick](https://awshq.com/t/amazon-quick-is-now-aws-quick/21686)
- [PHP critical updated](https://awshq.com/t/php-critical-updated/21653)

---

<div class="post-metadata">

**Author:** ![cochi78](https://awshq.com/letter_avatar_proxy/v4/letter/c/b5a626/32.png) [@cochi78](https://awshq.com/u/cochi78)\
**Post date:** [December 12, 2016, 8:47pm UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/2 "2016-12-12T20:47:10Z")

</div>

Mine usually consist of something like a line to install Chef and another one loading a cookbook bundle directly from S3 and executing recipes 🙂

---

<div class="post-metadata">

**Author:** ![ZiggyTheHamster](https://awshq.com/letter_avatar_proxy/v4/letter/z/ce7236/32.png) [@ZiggyTheHamster](https://awshq.com/u/ZiggyTheHamster)\
**Post date:** [December 12, 2016, 8:50pm UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/3 "2016-12-12T20:50:58Z")

</div>

I use auto scaling groups. My userdata is a script that configures the EC2 Container Service agent and downloads/starts Consul agent and Registrator. I also set the hostname of the machine to something slightly more helpful than `ip-XXX-XXX-XXX-XXX`.

FWIW, my image has already been set up using Chef, or else I’d do that too. I would just rather have one image that’s already good to go than an instance that takes 5 minutes to boot.

---

<div class="post-metadata">

**Author:** ![arrowsama](https://awshq.com/letter_avatar_proxy/v4/letter/a/8baadc/32.png) [@arrowsama](https://awshq.com/u/arrowsama)\
**Post date:** [December 13, 2016, 1:43am UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/4 "2016-12-13T01:43:52Z")

</div>

> [@ZiggyTheHamster](#):
>
> I use auto scaling groups. My userdata is a script that configures the EC2 Container Service agent and downloads/starts Consul agent and Registrator. I also set the hostname of the machine to something slightly more …

Do you use a chef server or chef-solo? how do you do auth if you’re using chef server?

---

<div class="post-metadata">

**Author:** ![ZiggyTheHamster](https://awshq.com/letter_avatar_proxy/v4/letter/z/ce7236/32.png) [@ZiggyTheHamster](https://awshq.com/u/ZiggyTheHamster)\
**Post date:** [December 13, 2016, 1:58am UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/5 "2016-12-13T01:58:41Z")

</div>

> [@arrowsama](#):
>
> Do you use a chef server or chef-solo? how do you do auth if you’re using chef server?

I use chef-zero because I only use Chef during the image building process and on boot (where all I’m doing is setting the hostname). As such, I just use Packer and drop all the Chef stuff on the box and then run chef-zero. The downside is that a cookbook change requires a new image, but we replace images frequently. This strategy means that if we find a problem with a new image (be it Chef related, OS related, or whatever) we can revert to the old image and be guaranteed that it will work exactly as before.

---

<div class="post-metadata">

**Author:** ![jdreaver](https://awshq.com/letter_avatar_proxy/v4/letter/j/a4c791/32.png) [@jdreaver](https://awshq.com/u/jdreaver)\
**Post date:** [December 13, 2016, 2:01am UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/6 "2016-12-13T02:01:29Z")

</div>

We just have a script that downloads SSH public keys and puts them in the appropriate spots so we can SSH in after. That way we don’t need to use some shared root private key.

---

<div class="post-metadata">

**Author:** ![loco\_ped](https://awshq.com/letter_avatar_proxy/v4/letter/l/779978/32.png) [@loco\_ped](https://awshq.com/u/loco_ped)\
**Post date:** [December 13, 2016, 6:02am UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/7 "2016-12-13T06:02:32Z")

</div>

Latest, enable EC2Config CloudWatch logs on Windows systems. Pick up the configuration JSON from s3. Soon to be replaced by SSM

---

<div class="post-metadata">

**Author:** ![ericzhill](https://awshq.com/letter_avatar_proxy/v4/letter/e/e99b99/32.png) [@ericzhill](https://awshq.com/u/ericzhill)\
**Post date:** [December 13, 2016, 6:03pm UTC](https://awshq.com/t/whats-in-your-userdata-sh/2741/8 "2016-12-13T18:03:58Z")

</div>

Yum updates, ssh keys, tmp mapping to ephemeral storage, codedeploy agent installation, cloudwatch custom monitor installation, and software prerequisite bundle.
