Manual Infrastructure Deployment
This guide provides step-by-step instructions for manually deploying AWS infrastructure using Terraform, offering more control and customization options.
Deployment Order
| # | Resource name | Repository |
|---|---|---|
| 1 | Terraform Backend | codemie-terraform-aws-remote-backend |
| 2 | IAM deployer role | codemie-terraform-aws-iam |
| 3 | Main AWS resources | codemie-terraform-aws-platform |
Step 1: IAM Deployer Role Creation
The DeployerRole AWS IAM role will be used for all subsequent infrastructure deployments.
The created IAM role contains required permissions to manage AWS resources
- Clone the repository:
git clone https://gitbud.epam.com/epm-cdme/codemie-terraform-aws-iam.git
cd codemie-terraform-aws-iam
- Review input variables in
codemie-terraform-aws-iam/variables.tfand create aterraform.tfvarsfile:
region = "your-region"
role_arn = "arn:aws:iam::xxx:role/yourRole"
platform_domain_name = "your.domain"
...
Ensure you have carefully reviewed all variables and replaced mock values with yours.
- Initialize and apply Terraform:
terraform init
terraform plan
terraform apply
Step 2: Terraform Backend Resources Deployment
This step creates:
- S3 bucket with policy to store terraform states
- DynamoDB to support state locking and consistency checking
- Clone the repository:
git clone https://gitbud.epam.com/epm-cdme/codemie-terraform-aws-remote-backend.git
cd codemie-terraform-aws-remote-backend
- Review input variables in
codemie-terraform-aws-remote-backend/variables.tfand create aterraform.tfvarsfile:
region = "your-region"
role_arn = "arn:aws:iam::xxx:role/yourRole"
platform_domain_name = "your.domain"
...
Ensure you have carefully reviewed all variables and replaced mock values with yours.
- Initialize and apply Terraform:
terraform init
terraform plan
terraform apply --var-file terraform.tfvars
The created S3 bucket will be used for all subsequent infrastructure deployments.
Step 3: Main AWS Resources Deployment
This step creates the following resources (see Architecture):
- EKS Cluster
- AWS ASGs for the EKS Cluster
- AWS ALB & AWS NLB
- AWS KMS key to encrypt and decrypt sensitive data
- AWS IAM Role to access AWS KMS and Bedrock services
- AWS IAM role ExternalSecretOperator to use AWS Systems Manager
- AWS RDS Postgres
- Optionally: internal AWS ALB and private DNS hosted zone for private network connections
- Clone the repository:
git clone https://gitbud.epam.com/epm-cdme/codemie-terraform-aws-platform.git
cd codemie-terraform-aws-platform/platform
- Review input variables in
codemie-terraform-aws-platform/platform/variables.tfand create aterraform.tfvarsfile:
region = "your-region"
role_arn = "arn:aws:iam::xxx:role/yourRole"
platform_domain_name = "your.domain"
...
Ensure you have carefully reviewed all variables and replaced mock values with yours
- Initialize and apply Terraform:
terraform init
terraform plan
terraform apply
This concludes AWS infrastructure deployment.
Post-Deployment Security Configuration
Ensure that you allowed incoming traffic to the Security Group attached to LoadBalancers from:
- Your VPN or from networks you're planning to work with AI/Run CodeMie
- EKS Cluster NAT Gateway EIP (not required if
enable_private_connectionsvariable is set totrue)
Next Steps
After successful deployment, proceed to Components Deployment to install AI/Run CodeMie application components.