How to run userData on EC2 instance


I am creating an EC2 instance with cdktf in ts. i am passing userData in its config in string form, but it is not getting executed on instance. userData is there in instance but not getting executed. Am I missing something to run userData on instance ?

A couple things to check: