Beanstalk Notes:

Overview:

Beanstalk is an AWS service that allows developers to quickly generate infrastructure without really having to understand the underlying technology.

I, personally, probably wouldn’t have bothered working it out; however, a recent M&A at my compnay uses it fairly regularly and I need to ensure I know how to configure, audit, and secure it.

I ran through a couple of tutorials and learning paths; however, each one that purported to show how to create a beanstalk deployment didn’t work for one reason or the other.

The best and most comprehensive learning path that I found was working my way through the AWS documentation at https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html. It’s a slog and a long one; but, the docs are excellent, well maintained, and up to date.

This doc isn’t designed to replace those; just add some items/concepts/lessons learned that I found on the way.

Memory map:

I recently came across memory maps and found I really like them. Having been a UNIX admin/engineer/architect for so long, I rarely do anything that’s not textual; however, the memory maps hit me more as a graphical checklist which I find very useful.

To that end, I have a memory map to follow for training. It’s a bit involved to show inline here so download the image or right-click and open in a new tab…

Lessons learned:

Re the first entry, I had issues getting eb to work correctly on a macbook pro. What finally ended up working, somewhat, is installing aws-elasticbeanstalk via homebrew. That, though, resulted in the error:

  • If receiving error like the below, edit create.py, line 221, change ‘is’ to ‘==’:

    eb --version
    .../site-packages/ebcli/display/screen.py:442: SyntaxWarning: assertion is always true, perhaps remove parentheses?
      assert(
    .../site-packages/ebcli/controllers/create.py:221: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if instance_types is "":
    EB CLI 3.20.10 (Python 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)])
    
  • Terminated eb enviorments stay in the display for an unknown period of time. Doesn’t appear to be any way to manually make them disappear. Eventually found the ‘delete env’ so this one’s not true.

  • If ‘managed updates’ are disabled, OS, runtime, app server, etc, patching is an end user responsibility.

  • eb config should display cloudformation config of beanstalk env. verify.

  • eb config save --cfg 01-base-state

eb commands:

eb init -p python-3.7 doleb0x001 –region us-east-1:

Initializes a beanstalk env. doesn’t launch anything.

eb create doleb0x001:

Creates the environment. This actually launches aws resources.

eb logs:

Retrieve logs. Seems quicker/better than console

eb status:

Obtains the status. A little harder to tell, w/limited experience, if things are working well.

eb terminate doleb0x001

Terminates the beanstalk environment.