-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: terraform script added for Infrastructure(IAC) #1
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have very little hands on experience with Terraform to be honest, but this looks sensible to me.
I do think it's a little insane how much config is required to set up an EC2 instance, S3, and DB 😂
Will this config change much over time / do you think it's maintainable?
|
||
|
||
# Redis-main | ||
resource "aws_elasticache_cluster" "redis-main" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we using Redis for in DroneTM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spwoodcock Initially i thought somewhere we would use celery for background task so i added configuration for Redis, For now i will comment this in the code and make a new PR.
Also, getting locked into an RDS managed database is a bad idea IMO. If we deploy the same way as FMTM, we won't need it. I would like to deploy a managed database cluster ourselves via Kubernetes to be honest - it's not too tricky. Could you give me a rough cost estimate for RDS for a year please so I can easily compare? |
Current Pricing Details@spwoodcock here is rough esitmate of our current setup from AWS Calculator:
Total Estimated Monthly Cost: 18.98 USD + 13.10 USD = 32.08 USD Note: This is a rough estimate. Additional charges such as data transfer costs may apply but are expected to be minimal. |
I would seriously doubt t3.micro would be good enough. Maybe at the start if we just deploy the API without a proxy it's fine, but with more services it's unlikely. Could we just remove RDS and manage our own database via a container for now. DroneTM needs to be easy to deploy outside of HOT/NAXA too, meaning not relying on vendor-locked technologies ideally. |
@spwoodcock , my thoughts on this is that its fine for IaC to be opinionated towards our needs or restrictions so long as sufficient documentation and images exist for others to build and deploy on their own infrastructure. I don't have an issue between running the database as a container vs RDS. Good "vendor-neutral" IaC should be engineered such that components are decoupled and either approach will work. Later down the line if we feel it beneficial to change (we need better backup management or IOPS controls), we can migrate the database over. A more pressing concern that I wished we had addressed earlier is that there seems to be some duplicated effort here with our existing terraform modules. Any chance you could look these over and see if there's some alignment with existing work? Questions on design:
|
Agree with your points! As you suggested, we should all have a call to discuss the way forward 👍 |
@dakotabenjamin @spwoodcock Thank you for the review lets discuss more on the call when everyone is free.cc @mahesh-naxa, @nischalstha9 .
We are using modules in Terraform to organize code by grouping similar services together. I have reviewed the Terraform modules you mentioned, where different repositories are created for each module. While that is a valid approach, it could introduce challenges with version management and state management across multiple repositories. Let’s discuss this further on our next call. If we plan to implement similar workflows across all HOT setups, organizing in that manner shouldn’t be an issue. Additionally, we are planning to use Terragrunt or OpenTofu for deployment across different stages (dev, stage, prod). I hope this modular architecture will support that. What are your thoughts on this?
And also, @spwoodcock, we have a complete setup that can be run on a single VM using different open-source services, which can also be migrated to managed vendor services and vice versa. Could you please review it? It’s in our repository. |
Hey @sijandh35, I'm not sure we really discussed the Drone TM infrastructure as a team. The only conversation I had about it was that NAXA would handle the deployments temporarily (i.e. a dev server), until HOT takes over in the future. With this in mind, we would probably align our deployment with other tools at HOT, including the IaC. But for the short term, do you think it's best we leave setting this up until we need it & have time to review it all together? Do you think this makes sense too @dakotabenjamin? |
Agreed @spwoodcock, i have been working on terraform modules on top of work that has been done by Yogesh, i believe we should setup a call so we can discuss and better align the work that we have been doing. Also i can use some help & direction as well. |
Introducing Terraform for Infrastructure Management
This pull request (PR) introduces Terraform for managing our project's infrastructure. Terraform, developed by HashiCorp, is an Infrastructure as Code (IaC) tool that will help us automate and streamline our infrastructure provisioning and management. By integrating Terraform, we aim to achieve consistency, scalability, and efficiency in our infrastructure processes.
Key Changes
Benefits
Testing
terraform plan
andterraform apply
commands in a staging environment.Next Steps
Notes