user_data

Terraform: invoking a startup script for an EC2 aws_instance

You can bake a startup script directly into the creation of your EC2 instance when using Terraform.  Although complex post-configuration should be left to tools such as Ansible, essential bootstrap type commands or custom routes for instances in private subnets are reasons why you might need to use this hook. Below is an example of Terraform: invoking a startup script for an EC2 aws_instance