What is User Data in AWS or Terraform?

Problem scenario
You have heard about user data in AWS or Terraform. What is it?

Answer for AWS
Generally it is a customization that the account owner configured to apply to an EC-2 instance when it first launches. It is either a shell script or a cloud-init directive that is used when an EC-2 instance is launched (according to
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html).

Shell scripts that the customer provides are self-explanatory. The cloud-init directives are for SSH key configuration (according to
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-cloud-init).

Answer for Terraform
It is one or more bash commands that run when a server is initially created and booted (according to page 14 of Terraform Up & Running).

Leave a comment

Your email address will not be published. Required fields are marked *