Skip to main content

Introduction

Manage AWS resources using Kubernetes CRDs/GitOps or standalone CLI.

What is Infra Operator?

Infra Operator is a production-ready tool for managing AWS infrastructure resources. It can run in two modes:

  • Kubernetes Operator: Manage AWS resources using CRDs, kubectl, and GitOps (ArgoCD, Flux)
  • Standalone CLI: Manage AWS resources directly from command line, without Kubernetes

Instead of using separate tools like Terraform or CloudFormation, you can manage your AWS infrastructure using familiar YAML manifests.

Key Benefits

Manage infrastructure alongside applications using Git as the source of truth

Use kubectl, Helm, and familiar Kubernetes ecosystem tools

Well-organized, testable (100% coverage), and maintainable code following architecture patterns

Full support for networking, compute, storage, database, messaging, CDN, security, and more

Supported Services (26 Total)

Networking (9 services)

ServiceDescription
VPCVirtual Private Cloud
SubnetVPC Subnets
Internet GatewayInternet access for VPC
NAT GatewayOutbound internet for private subnets
Security GroupFirewall rules
Route TableNetwork routing
ALBApplication Load Balancer (Layer 7)
NLBNetwork Load Balancer (Layer 4)
Elastic IPStatic public IP addresses

Compute (3 services)

ServiceDescription
EC2 InstanceVirtual machines
LambdaServerless functions
EKSKubernetes clusters

Storage & Database (3 services)

ServiceDescription
S3 BucketObject storage
RDS InstanceRelational databases (PostgreSQL, MySQL, etc.)
DynamoDB TableNoSQL database

Messaging (2 services)

ServiceDescription
SQS QueueMessage queues
SNS TopicPub/Sub notifications

API & CDN (2 services)

ServiceDescription
API GatewayREST, HTTP, WebSocket APIs
CloudFrontContent Delivery Network (CDN)

Security (4 services)

ServiceDescription
IAM RoleIdentity and access management
Secrets ManagerSecrets storage
KMS KeyEncryption keys
ACM CertificateSSL/TLS certificates

Containers (2 services)

ServiceDescription
ECR RepositoryContainer registry
ECS ClusterContainer orchestration

Caching (1 service)

ServiceDescription
ElastiCacheIn-memory cache (Redis, Memcached)

Quick Example

Example:

---
# Create VPC
apiVersion: aws-infra-operator.runner.codes/v1alpha1
kind: VPC
metadata:
name: production-vpc
spec:
providerRef:
name: aws-provider
cidrBlock: "10.0.0.0/16"
enableDnsSupport: true
enableDnsHostnames: true

---
# Create Public Subnet
apiVersion: aws-infra-operator.runner.codes/v1alpha1
kind: Subnet
metadata:
name: public-subnet
spec:
providerRef:
name: aws-provider
vpcID: vpc-xxx # Will be filled automatically
cidrBlock: "10.0.1.0/24"
mapPublicIpOnLaunch: true

---
# Create S3 Bucket
apiVersion: aws-infra-operator.runner.codes/v1alpha1
kind: S3Bucket
metadata:
name: app-data
spec:
providerRef:
name: aws-provider
bucketName: myapp-production-data
versioning:
enabled: true
encryption:
algorithm: AES256

Command:

kubectl apply -f infrastructure.yaml

Architecture

System Overview

Infra Operator follows the Kubernetes controller pattern architecture:

How It Works:

  1. GitOps / kubectl - Creates Custom Resources (CRs) in Kubernetes
  2. Controllers - Detect changes in CRs and reconcile state
  3. AWS SDK - Controllers use AWS SDK to provision resources
  4. Status Update - AWS resource state is reflected in the CR

Main Components:

  • 26 Controllers: One for each AWS service (VPC, S3, EC2, Lambda, etc.)
  • 26 CRDs: Custom Resource Definitions for each resource type
  • AWS SDK v2: Communication with AWS APIs
  • Reconciliation Loop: Ensures desired state = actual state

Clean Architecture

Implementation following Clean Architecture principles for testable (100% coverage), maintainable, and decoupled code:

Architecture Layers:

1. Domain Layer (Core)

  • Pure business models (VPC, S3, EC2, etc.)
  • Validation rules
  • No external dependencies
  • 100% test coverage

2. Use Cases Layer

  • Application logic
  • Create, Update, Delete, GetStatus
  • Domain orchestration
  • Interface with Ports

3. Ports Layer (Interfaces)

  • Repository interfaces
  • Cloud Provider interfaces
  • Dependency inversion principle
  • Abstract contracts

4. Adapters Layer

  • AWS SDK implementations
  • Kubernetes client
  • Concrete implementations of Ports
  • Communication with external systems

5. Controllers Layer

  • Reconciliation loops
  • Kubernetes API integration
  • Event handling
  • CR to Domain mapping

Benefits:

  • Testability: 100% coverage in domain
  • Maintainability: Clear separation of concerns
  • Flexibility: Easy to add new services
  • Independence: Core decoupled from frameworks

Next Steps