I'm currently part of a startup where we have several EC2 instances running, along with a web application hosted on Elastic Beanstalk. We also use services like Redis ElastiCache and S3 for storage. Unfortunately, our setup is quite chaotic. We haven't set up proper logging, we have random Elastic IPs assigned to EC2 instances, and there are a lot of unnecessary admin roles assigned through IAM. Our VPC setup seems to serve no real purpose, and we don't use Terraform for infrastructure as code. I'm looking for guidance on how to restore order and implement best practices to create a more efficient DevOps environment. Where should I begin?
3 Answers
Consider creating a new AWS account managed by Terraform where no one has direct write permissions. Terraform should be set to auto-deploy from a Git repository, or you might want to look into using CloudFormation, CDK, or Pulumi for your infrastructure management. It's crucial to have a solid plan before you start migrating; understand what dependencies you have to avoid confusion during the transition.
First off, take a deep breath! It's a lot to tackle, but don't try to do everything at once. Start by cleaning up your IAM roles because having admin access everywhere can seriously compromise your security. Once that's sorted, focus on setting up logging with CloudWatch or CloudTrail, so you know what's happening in your environment. Document your current setup, then migrate services into Terraform one at a time instead of attempting a complete overhaul all at once. If you try to rebuild everything at once, you might end up causing downtime and frustrating your team.
To improve your logging, make sure to enable streaming to CloudWatch from the Elastic Beanstalk console; it's simply a checkbox. Also, if you're running multiple EC2 instances, check if you're using an Application Load Balancer (ALB), which could help organize your setup better. Elastic Beanstalk does a good job organizing resources, but if you have many EC2 instances outside of that, it could look messy.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures