Reputation: 604
I've just created a new Launch Configuration to use with an Auto Scaling group. When a new EC2 instance is launched, I would like the script to be executed.
In details:
deploy.sh
that updates my application code using git...My user data is:
#!/bin/bash
/home/ec2-user/deploy.sh
This doesn't work.
Upvotes: 0
Views: 3059
Reputation: 604
I've checked cloud-init-output.log
and seems everything is okay.
I've done another test now and the new instance has the right code.
Probably there was a syntax error in launch configuration user data.
So, the right user data is
#!/bin/bash
/home/ec2-user/deploy.sh
Now I should add yum update
before my custom script.
Upvotes: 0
Reputation: 5887
Can you check the permission of your deploy script?
You can login to the instance and check the logs of User Data execution. Logs are at /var/log/cloud-init-output.log
Upvotes: 6