amazon web services - Can I trigger tasks to run straight after an EC2 instance has been created? -


i interested in running set of tasks after new ec2 instance has been created. @ moment doing running bash shell script via ec2's user-data option.

however want move away using user-data (or @ least reduce size of shell script as possible), , instead run shell script on existing ec2 instance (which happens ansible server).

does know if possible? maybe using aws service e.g. cloudwatch, sns, sqs, lambda,...etc. e.g. can cloudwatch issue message sns newly built ec2 instance reaches healthy state?

there many ways solve problem. options have used in past include:

creating upstart scripts on ec2 instance , creating new ami these inplace. launch future instances using ami (simple inflexible ami creation slow).

do programmatic using eg. boto query aws , find out when newly launched boxes available using eg. paramiko ssh in , issue commands (much more flexible more effort).

hope helps.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -