Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Beanstalk Application Health Check

We use Beanstalk to deploy node applications. Works very well. I've created a couple of config files in an .ebextensions directory, to apply configuration info to our apps when we load them up. Again mostly works well. I have one thing that does not, and that is defining the application health check URL. I can't get it to go. One odd thing about it, it seems to be only parameter I have come across so far that has spaces in it, and I'm wondering about that. I have tried enclosing the values in quotes, just to see if that is the problem, but it still doesn't work. Has anyone done this before, and can tell me whether it works, and if there is something syntactical about this that is incorrect? As I said, the rest of the params get set correctly in beanstalk, just the last one doesn't. Note #environment# gets replaced with a grunt script before this gets deployed.

Here's the config file:

 option_settings:
   - namespace: aws:elasticbeanstalk:application:environment
     option_name: NODE_ENV
     value: #environment#
   - namespace: aws:elasticbeanstalk:container:nodejs
     option_name: NodeVersion
     value: 0.10.10
   - namespace: aws:autoscaling:trigger
     option_name: LowerThreshold
     value: 40
   - namespace: aws:autoscaling:trigger
     option_name: MeasureName
     value: CPUUtilization
   - namespace: aws:autoscaling:trigger
     option_name: UpperThreshold
     value: 60
   - namespace: aws:autoscaling:trigger
     option_name: Unit
     value: Percent
   - namespace: aws:elasticbeanstalk:application
     option_name: Application Healthcheck URL
     value: /load_balance_test
like image 867
CargoMeister Avatar asked Nov 01 '13 22:11

CargoMeister


2 Answers

The spaces in this property name are weird, but it works when used with the alternative shorthand syntax for options:

option_settings:

  aws:elasticbeanstalk:application:
    Application Healthcheck URL: /
like image 26
Samuel Fekete Avatar answered Nov 25 '22 14:11

Samuel Fekete


Adding this worked for me:

# .ebextensions/healthcheckurl.config
option_settings:
  - namespace: aws:elasticbeanstalk:application
    option_name: Application Healthcheck URL
    value: /health
  - namespace: aws:elasticbeanstalk:environment:process:default
    option_name: HealthCheckPath
    value: /health

I discovered the second setting by doing eb config, which gives a nice overview of environment settings that can be overriden with option_settings in .ebextensions/yet-another.config files.

like image 79
cmc Avatar answered Nov 25 '22 14:11

cmc