I allow myself to create this topic because I am trying to use the EC2 launch templates feature of AWS through terraform in order to create machines from it.
So I use AWS_launch_template and in the part: user_data = filebase64 ("$ {path.module} /") I filled in a bash script in which I simply do an apt update and upgrade before installing NGINX .

Then, when I want to create my machine (aws_instance) I fill in the part: launch_template by specifying my template.
However when I connect to the machine via SSH I realize that the shell script containing the commands has not been executed.

Can you help me understand why?