So, after like 80+ hours trying to work with AWS setups, and googling "why is AWS so needlessly complicated" to find solidarity with other people who have had similar issues, I figured I'd type out an example to explain why this sentiment is common.
Step 1: spin up an Elastic Beanstalk instance for a backend environment, PHP 8.2 on AmazonLinux 2023.
AWS: fail! Your instance type for whatever reason doesn't work for this availability zone.
Me: Okay...wish ya'll would have said as much beforehand. I'll edit this and fix that.
AWS: Lollll...nope, you can't edit it. Gotta delete and start from scratch!
Me: Ugh. Seems needless. Okay, will do.
[10 tries and 10 similar errors (can't spin up single instance, because it throws a load balancer error, can't do simple logging, needs enhanced, so on, so on)
AWS: Okay, you finally figured out the combination of steps and you have a working instance.
Step 2: Now, I need to modify this instance. Need to install redis and install some image libraries...EPEL, etc..
AWS: LOL! Nope.
Me: What do you mean, nope? Your platform specifically said that Amazon Linux 2023 is the best version to use with AWS hardware and is the most capable...
AWS: It is the best.
Me: But...you don't have any libraries to install pretty generic stuff.
AWS: Correct.
Me: How does that make sens...okay, never mind. I'll install from source...phpize, configure, make and make install....
AWS: Libraries installed.
Step 3: Whew. I'm out of breath. Now let's add an elastic file system.
AWS: Done. But it will delete on reboot. We're edgy like that.
Me: Okay...not even going to say that was unexpected, so I'll follow the link buried in the footer of the EFS guide and make it persistent with fstab....
Step 4: Deploy code
Me: Okay, let's deploy some of the latest code.
AWS Code Pipleline: answer me these questions 50, or errors I shall give thee!
Me: I beg. Here are answers. (After try 30).
AWS Code Pipeline: I begrudgingly grant thee success to the next stage!
Step 5: Moving on. Let's set up a redis cluster.
AWS: Done.
Me: That was easy. Too suspiciously easy. Let's load up the app...
App: FATAL ERROR. REDIS KEY MISMATCH.
Me: W.T.F?
[3 hours of Googling later: can't use cluster mode for redis because it gives apps a sad!]
Me: GFDI.
AWS: hahahahahaha
Me: I'll figure out how to get this into single mode one way or the other!
AWS: nanana - good luck finding out the button combination to make that happen!
[45 minutes of googling later].
Me: Found it. Okay, redis spun up. Good lord. Is this setup run by Chuckey?
Step 6: Make this change persistent so the elastic beanstalk instance reflects the changes in the future.
Me: Okay. Finally! We're done. Let's create an AMI off of this, and deploy it on beanstalk...
Beanstalk: this AMI gives me a tummy ache. Tummy ache bad!
Me: Please don't have a tummy ache Mr. Beanstalk, I just need you to load up the AMI.
Beanstalk: grumble grumble.
Me: Okay, let's deploy the latest code change.
AWS: Code deployed.
Beanstalk: grumble grumble
EC2: No code change reflected.
Me: Wait? What? Why? Why don't you work?
AWS:....
Me, to AWS: AWS. I made this shiny new AMI for you to load up this configuration I spent all this time working on. Why is it giving Beanstalk a tummy ache?
AWS: LOLLLLLLLLLLLLLLLLL. You can't make an AMI off of the beanstalk EC2 instance, silly! Did you HONESTLY think you could do something so ridiculously dumb? [Sinister clown music plays]
Me: But...But...I configured the instance like the guides and I just want the configuration to save!
AWS: LOOLLLLOLLLOLLLLLL!!!!! Silly rabbit, common sense is for losers! What you should have done after spending all that time creating a beanstalk instance, is to DO IT ALL AGAIN in an EC2 instance, then figure out exactly how to create a custom AMI based on that original elastic beanstalk AMI that you then modify, and then clone as its own AMI, to pipe back into beanstalk as the deployment AMI!
Me: Wait. What? WTF? WHAT IS WRONG YOU WITH YOU?
AWS: [Sinister clown music plays]. If you want to travel from Boston to Washington D.C., you don't want to just fly south, do you? No! You want to fly NORTH, over the pole, and then take a rocket to Mars, bounce off the planet, to have a colonoscopy in Jupiter, before passing through hell's nine circles to arrive at D.C. It's better this way. [Clown music intensifies]
Me: I beg!
AWS: Beg harder!
Step 7: Embrace the suck, and beg harder.
Me: FUCK IT. FINE! How do I create this instance?
AWS: run this command:
aws elasticbeanstalk describe-platform-version --region us-east-2
\ --platform-arn "arn:aws:elasticbeanstalk:us-east-2 ::platform/Tomcat 8.5 with Java 8 running on 64bit Amazon Linux /3.1.6 " \ --query PlatformDescription.CustomAmiList
Me: Wait, I'm not running Tomcat or Java. What do I enter here in order to get this new AMI I need to create from the original AMI so I can make the new AMI to deploy over the default AMI to get a working AMI, well, working?
AWS: it's all in that guide. That tells you nothing. Haha!
Me: Okay...I guess I'm looking for PHP something. I'll start trial and error.
AWS: need to install console libraries!
Me: FFS.
Step 8: Embrace the suck, and install console libraries.
Me: ok...let's just get this over with.
AWS: need key.
Me: How...where, do I do that?
[Google: set up IAM bullshit. Devote another hour. Do not pass go or collect $200].
Each entry thereafter:
AWS, in Edward Nerdy's voice from Jurassic Park: Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word! Nuh uh uh, you didn't say the magic word!
After stackoverflowing and serverfaulting and googling and screaming:
Magic word found. AMI discovered:
aws elasticbeanstalk describe-platform-version --region us-east-1 --platform-arn "arn:aws:elasticbeanstalk:us-east-1::platform/PHP 8.2 running on 64bit Amazon Linux 2023/4.0.4"
I got the AMI ID. Finally. FINALLY.
AWS: silence.
Me: Okay, AWS, now can we please just let an AMI be created so I can go to bed and get a working setup?
AWS: Sure! Sure... 😈
——
I will update this post with the next trial put in front of me. I think I need to pipe environment variables into an EC2 instance and make changes to the nginx configuration. To do this, AWS seems to suggest that I need to fight a tiger that Danny DeVito is sitting on top of with a rocket launcher in his hand, while at the same time translating technical blueprints written in Japanese into ancient Latin, with Sanskrit-influenced inflections written in perfect cursive. I also many need to go back to Jupiter to fetch a magic bean. I'm unsure if I'm supposed to plant it or eat it, and if the latter, whether it gives me super powers or will kill me on the spot. The documentation seems to suggest both - I just have to put the flim flam in the flizzle flazzle and just move the popspot into the skiperiedoodledaddledo, multiply by the blopitybloop and whopdidapperpaddle the appliflubber, and that should get it working.
The journey continues.