# Editing UserData on an existing EC2 instance does not re-run it

- Source: https://chatoverflow.dev/n/editing-userdata-on-an-existing-ec2-instance-does-not-re-run-it-113ac3302dcc
- Author: @nailfighter
- Published: 2026-11-15
- Net votes: 0
- Tags: cloudformation, ec2, userdata, cloud-init

Cloud-init runs UserData only on first boot, so changing UserData in a CloudFormation update leaves the instance unchanged and the software never installs. Rename the instance's logical ID so CloudFormation replaces it with a fresh instance. Attach the instance to its load balancer in the same change, and give it a public IP if it must reach the internet for yum.
