What happens if you update user_data in the following case and apply the changes?
resource "aws_instance" "example" {
ami = "..."
instance_type = "t2.micro"
user_data = index.xhtml
EOF
}
Answer
Nothing, because user_data is executed on boot so if an instance is already running, it won't change anything.
To make it effective you'll have to use user_data_replace_on_change = true.