AWS CloudFormation where will UserData be stored?


if I have a AWS CloudFormation template using UserData block containing script block to be executed, for example:

After the instance is created,

  1. I assume that this script block will be saved somewhere to be execute?
  2. If so, where can I find this script on the EC2 instance?
  3. Will AWS remove this temporary script after stack is created successfully?

I could not find they mention in the doc.



The user-data for an instance is available for any process on the instance to retrieve at this location:

The DNS name “instance-data” resolves to that IP address, so if you trust DNS to be up, you can also use the easier to remember:

Here are the Amazon docs:

Leave a Reply