3

I have a powershell script in the .ebextensions folder but its not executing. It used to work but suddenly has stopped working and there have been no changes to elastic beanstalk or the scripts that i know off. I have two instance running under elastic beanstalk and if I log into one and then deploy my package it doesnt take the instance down. I can literally watch the service (IIS Rest service) files being updated.

Elastic Beanstalk is configured for autoscaling min 2 instances max 4. I've tried doing a deploy though the AWS Elastic Beanstalk console but no joy.

Does it need to actually take the instances down in order to run the scripts? I find it odd that it can update the service without stopping the instance.

Also do .ebextension scripts not execute against running instances? is there a way to force it to execute?

What else can I check to see why the ebextensions are not being picked up?

Thanks

There is no spoon
  • 1,775
  • 2
  • 22
  • 53
  • Maybe not in this specific case, but sometimes it is a matter of [precedence](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#configuration-options-precedence). – djvg Nov 27 '20 at 11:56

2 Answers2

3

It's working now. My ebextensions script was not formatted properly, i.e. didn't have the necessary indentations that YAML requires so the commands where being ignored. However no error was raised by EB.

There is no spoon
  • 1,775
  • 2
  • 22
  • 53
  • Did your script fail when you pasted it into a YAML validator? Currently the EB publish process will fail when that's the case. I'm experiencing similar issues but my YAML indents seem OK. – Eric Hirst Apr 04 '19 at 20:53
3

Another problem is that eb cli uses git to bundle your app, which means that you need to perform a commit so that all changes are properly bundled.

Until I get my changes right, I keep doing git add & git commit --amend all the time...

Rui Ferrão
  • 199
  • 1
  • 9
  • Also @Rui, if you simply stage your file changes, you can still deploy your app without committing. I.e. with `git add .` and then `eb deploy --staged`. See: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cli-git.html It's a great alternative to needing to commit for every single trial & error change. – stwr667 Mar 27 '19 at 12:59
  • Thank you @stwr667, I was not aware of that. It is very clear on the aws docs, but for some reason I find those docs a very hostile place to be in and it got passed me... Thanks! – Rui Ferrão Apr 01 '19 at 10:54