Daniele
Daniele

Reputation: 604

EC2 launch configuration user data is not executed

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:

My user data is:

#!/bin/bash
/home/ec2-user/deploy.sh

This doesn't work.

Upvotes: 0

Views: 3059

Answers (2)

Daniele
Daniele

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

Sudharsan Sivasankaran
Sudharsan Sivasankaran

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

Related Questions