ELB cli Thoughts
Billy Fung / 2018-06-27
The entire process of using AWS Elastic Beanstalk (ELB) was relatively painful in my opinion. I won’t say that I’m an expert level AWS user, having to use the AWS console for many things and not often scripting stuff. But I do have a fair grasp of the AWS ecosystem, and how varies products work together.
To start off, I’m using mainly the ELB cli, which I installed using:
pip install eb-cli
Start off building the fence
Like all good cloud users, we start off with setting up an IAM user with access to ELB and nothing else, unless you want it to have access to other products. It is always important to build a fence to limit the area that your scripts can roam. Otherwise this will lead to blog posts titled “Rogue script caused a $1000 AWS bill”, or something along those lines.
I’ll try my best not to just repeat the AWS documentation for this one, but really there isn’t much to it. Using the created access ID and key for the IAM user.
eb init
Starts off the process, and from there you pretty much just follow the instructions for choosing: 1. Region 2. Application name 3. Platform (Node, Python, Ruby, etc…) 4. Keypair
And after all that you’re done setting up a load balancer, EC2, and S3. There’ll also be various other things I haven’t really looked into yet, but that’s the basic needs looked after.
Database configuration
If you need a new database for the application, then within the ELB console UI (or through elb cli), on the configuration page you can set up a RDS instance with the appropriate database settings. Setting it up this way means AWS will couple everything together, so when you delete the ELB application, everything gets deleted.
If you want to link it to an already set up RDS instance, then it’s a bit more involved. This is the case if you already have a production database that you want your ELB app to talk to. Luckily the documentation is very straightforward and following that worked out fine for me.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.RDS.html
Add more fencing
Using things like Cloudwatch notifications is also important to prevent your AWS bill getting out of hand. The major downside of using cloud in general is that it’s so easy for things to go astray and then you aren’t aware of it.