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
Post a Comment