Skip to content

AWS Provider Implementation (Production Requirement)

AWS Provider Implementation

Priority: HIGH (Production Requirement)
Status: Not Started
Estimated Time: 5-7 days
Dependencies: Issue #5 (Multi-Cloud Abstraction Layer)

Description

Implement AWS as a cloud provider, enabling users to provision EC2 instances, RDS databases, and other AWS services.

Implementation Details

  1. Install Dependencies (app/requirements.txt):
boto3>=1.28.0
botocore>=1.31.0
  1. Create AWS Provider (app/services/providers/aws_provider.py):
from .base_provider import CloudProvider
import boto3

class AWSProvider(CloudProvider):
    def __init__(self, config: Dict):
        self.region = config.get('region', 'us-east-1')
        self.access_key = config['access_key']
        self.secret_key = config['secret_key']
        self.ec2 = boto3.client('ec2', 
            region_name=self.region,
            aws_access_key_id=self.access_key,
            aws_secret_access_key=self.secret_key)
    
    async def create_instance(self, config: Dict) -> Dict:
        # Implementation using boto3
        pass
  1. Create Terraform Modules (orchestration/terraform/modules/aws/):
aws/
├── ec2_instance/
│   ├── main.tf
│   ├── variables.tf
│   └── outputs.tf
├── vpc/
│   ├── main.tf
│   ├── variables.tf
│   └── outputs.tf
├── rds/
│   ├── main.tf
│   ├── variables.tf
│   └── outputs.tf
└── elasticache/
    ├── main.tf
    ├── variables.tf
    └── outputs.tf
  1. API Endpoints (app/api/aws_providers.py):
@router.get("/settings/aws")
async def list_aws_providers():
    """List AWS configurations"""
    pass

@router.post("/settings/aws")
async def create_aws_provider(config: AWSProviderCreate):
    """Add AWS account"""
    pass

@router.post("/settings/aws/{id}/test")
async def test_aws_connection(id: int):
    """Test AWS connection"""
    pass
  1. Frontend Component (frontend/src/lib/components/settings/AWSProviderManager.svelte):

    • Similar to ProxmoxServerManager
    • Fields: Name, Region, Access Key, Secret Key
    • Test connection button
    • List of configured AWS accounts
  2. Service Templates:

    • Ubuntu on EC2 (t3.micro, t3.small, etc.)
    • PostgreSQL on RDS
    • Redis on ElastiCache

Test Strategy

  • Test AWS credential validation
  • Create EC2 instance via UI
  • Verify Terraform generates correct AWS resources
  • Test instance lifecycle (start, stop, terminate)
  • Verify RDS database creation
  • Test ElastiCache provisioning
  • Test cost estimation

Deliverables

  • AWSProvider class
  • AWS Terraform modules
  • AWS API endpoints
  • AWS UI component
  • AWS service templates
  • Integration tests

Labels: backend, frontend, terraform, aws, multi-cloud

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information