The client had an On-premises Infrastructure, but with an increasing customer base, they want to move to the AWS cloud for better scalability along with multiple environments. The infrastructure needed to be managed for different environments with minimal changes.
Migration of an On-premise Infrastructure to Cloud
As part of MVP-1: We need to configure IAM user, EKS cluster, S3 bucket, RDS instance and Route 53 via Terraform.
As part of MVP-2: Need to configure CICD to apply change in terraform and manage terraform state file remotely so multiple developer can work together.
As part of MVP-3: Manage different environment via different git branch.
- Configured IAM user, EKS cluster, s3 bucket RDS instance, and route 53 using AWS predefined modules in Terraform.
- We had an AWS role configured for Jenkins VM to pull secrets from the Secret Manager. Followed by a Jenkins job that gets AWS credentials from the Secret Manager which will run terraform commands on the cloud agent via Terraform container.
- As the client wanted to have all environments similar to each other we suggested using terraform workspace, where we reused all terraform modules for every environment keeping differences in the variable.
- To achieve that we relied on git branching: We had different branching for different environments and based on different branching different Jenkins jobs executed the terraform changes.
- For all Terraform-based jobs, we ran the refresh and plan command to check the changes before applying them.
- We integrated slack alerts at all Job statuses for better monitoring and alerting.
- GIT was a single source of truth for managing the infrastructure.
- Migrated all components to from Data centre to AWS
- Used terraform to manage infrastructure
- Use same terraform modules for all environments via terraform workspace