amazon web services - Windows EC2 initial config from AMI after autoscale boot up -


i'm looking @ autoscaling off-the-shelf amazon provided windows ami (as opposed custom one).

after new instance gets booted (and before!! gets added load balancer), want initialization tasks injected , ran on new instance (say, running powershell script).

secondly, loadbalancer needs know start sending requests new ec2 instance after startup script has finished (not sure how either).

after new instance gets booted (and before!! gets added load balancer), want initialization tasks injected , ran on new instance (say, running powershell script).

take @ userdata. long , short of can configure instances run small script when launched, can used bootstrapping.

a common practice include enough code in userdata download variable script central location (e.g. git repository or secure s3 bucket), execute - way can version , change actual script doing work without having update userdata.

secondly, loadbalancer needs know start sending requests new ec2 instance after startup script has finished (not sure how either).

load balancers tend perform kind of ping request instances 1 specified port, specified file determine if healthy or not. i'm not sure windows ami for, should work in same way. need point @ file available once bootstrapping complete - i.e. maybe bootstrapping script creates health.txt file somewhere in system "ok" contents, , load balancer can ping file until exists -> it's healthy.

if go above idea, ensure health.txt doesn't exist part of ami use spin auto-scaled instances with, otherwise created file in place , may register false positive before userdata/bootstrapping script has completed.

for example lamp stack, it's reasonably easy quantify because example userdata script might following:

  1. clone git repository
  2. clean cache
  3. set file/folder permissions
  4. create "health.html" in apache web root "ok" contents, it'll return 200 header when pinged
  5. start apache

in example, load balancer ping server's /health.html file every until returns 200 header, occur once step 5 above has completed.

i'm sure you'll able work out similar fit windows ami.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -