InfraForge is an innovative Infrastructure as Configuration (IaC) framework that revolutionizes how organizations deploy and manage AWS resources. Built with AWS CDK and Go, this enterprise-grade solution transforms complex cloud architectures into simple JSON configurations through its modular "forge" component system.
InfraForge allows you to define, deploy, and manage complex AWS infrastructure using a configuration-driven approach. The framework abstracts away the complexity of AWS CloudFormation and CDK, providing a higher-level interface for common infrastructure patterns.
The system is designed as a comprehensive platform that supports any AWS service and solution, allowing continuous optimization and enhancement through its modular architecture. InfraForge delivers significant business value by enabling rapid deployment, cost reduction, and operational simplification.
The InfraForge architecture consists of four key components:
- π€ Amazon Q CLI: Natural language understanding and intent processing
- π§ MCP Server: Self-learning solution discovery and intelligent guidance generation
- βοΈ InfraForge Engine: Modular deployment orchestration and dependency management
- π Solution Templates: Configuration-driven infrastructure patterns and best practices
- Modular Architecture: Infrastructure components are organized as "forges" that can be composed together
- Configuration-Driven: Infrastructure defined through JSON configuration files
- Multi-Resource Support: Supports various AWS services including DS, EC2, ECS, EKS, EFS, FSx Lustre, and more
- Cross-Stack References: Resources can reference and depend on each other
- Flexible Deployment Options: Deploy entire stacks or individual components
- Amazon Q Integration: Optional MCP server for conversational infrastructure management
InfraForge/
βββ cmd/ # Command-line interface code
β βββ infraforge/ # Main CLI application and executable
βββ configs/ # Solution-specific configuration files
β βββ batch/ # AWS Batch solutions
β βββ bench/ # Benchmarking solutions
β βββ directoryservice/ # Directory Service solutions
β βββ ec2/ # EC2 solutions
β βββ ecs/ # ECS solutions
β βββ eks/ # EKS solutions
β βββ enclave/ # Enclave solutions
β βββ hyperpod/ # SageMaker HyperPod solutions
β βββ kafka/ # Kafka solutions
β βββ kudu/ # Kudu solutions
β βββ kubernetes/ # Kubernetes solutions
β βββ netbench/ # Network benchmarking solutions
β βββ parallelcluster/ # AWS ParallelCluster solutions
β βββ rds/ # RDS solutions
β βββ redroid/ # Redroid solutions
β βββ web3/ # Web3 solutions
βββ core/ # Core framework functionality
βββ forges/ # Infrastructure component implementations
β βββ aws/ # AWS-specific forge implementations
β β βββ batch/ # AWS Batch forges
β β βββ ds/ # Directory Service forges
β β βββ ec2/ # EC2 instance forges
β β βββ ecs/ # ECS cluster and service forges
β β βββ eks/ # EKS cluster forges
β β βββ hyperpod/ # SageMaker HyperPod forges
β β βββ iam/ # IAM role and policy forges
β β βββ lambda/ # Lambda function forges
β β βββ parallelcluster/ # AWS ParallelCluster forges
β β βββ rds/ # RDS database forges
β β βββ storage/ # Storage-related forges (EFS, FSx)
β β βββ vpc/ # VPC and networking forges
β βββ desktop/ # Desktop environment forges
β βββ kubernetes/ # Kubernetes-related forges
β βββ monitoring/ # Monitoring and observability forges
βββ registry/ # Forge registry and management
βββ scripts/ # User data scripts and templates
βββ tools/ # Utility tools and scripts
βββ docs/ # Documentation
βββ examples/ # Example configurations and usage
βββ tests/ # Test cases and test utilities
InfraForge uses JSON configuration files to define infrastructure. The main configuration file is config.json, which defines:
- Global settings like stack name
- Enabled forges to deploy
- Resource configurations for different forge types
Solution-specific configurations are stored in the configs/ directory with naming convention config_<solution>.json. To use a specific solution configuration, copy it to cmd/infraforge/config.json before deployment.
Example configuration structure:
{
"global": {
"stackName": "aws-infra-forge",
"dualStack": true
},
"enabledForges": [
"efs1",
"ecs1",
"ds1",
"windows2022",
"ubuntu2204",
"al2023"
],
"forges": {
"vpc": { ... },
"ds": { ... },
"efs": { ... },
"lustre": { ... },
"ecs": { ... },
"eks": { ... },
"ec2": { ... }
}
}InfraForge currently supports the following forge types:
- VPC: Network infrastructure with public, private, and isolated subnets
- EC2: Virtual machines with various OS options (Amazon Linux, Ubuntu, Windows, CentOS)
- ECS: Container orchestration with Fargate and EC2 launch types
- EKS: Managed Kubernetes clusters with Karpenter support
- AWS Batch: Managed batch computing service
- AWS ParallelCluster: HPC cluster management
- SageMaker HyperPod: Distributed machine learning training
- RDS: Managed relational database service
- EFS: Elastic File System for shared storage
- FSx Lustre: High-performance file systems for compute workloads
- Lambda: Serverless functions
- IAM: Identity and access management resources
- Directory Service: Managed Microsoft Active Directory
- Go 1.23 or later
- AWS CDK CLI
- AWS CLI configured with appropriate credentials
- Node.js (required by CDK)
-
Clone the repository:
git clone https://github.com/awslabs/InfraForge.git cd InfraForge -
Install dependencies:
go mod download -
Build the application:
cd cmd/infraforge go build
-
Choose a solution configuration from the
configs/directory:# For example, to use the ParallelCluster solution: cp configs/parallelcluster/config_parallelcluster.json cmd/infraforge/config.json # Or to use the benchmarking solution: cp configs/bench/config_sysbench.json cmd/infraforge/config.json -
Run the bootstrap script:
./bootstrap.sh -
Deploy your infrastructure:
cd cmd/infraforge ./deploy.sh -
To destroy the infrastructure:
./destroy.sh
For conversational infrastructure management with Amazon Q:
-
Build the MCP server:
cd tools/mcp/ go build sudo cp infraforge_mcp_server /usr/local/bin/ sudo chmod +x /usr/local/bin/infraforge_mcp_server -
Add the MCP server to Q CLI:
q mcp add --force --name infraforge --command infraforge_mcp_server --timeout 7200000
-
Prepare the working directory:
cd cmd/infraforge cp -r ../../configs .
-
Start Amazon Q Chat with InfraForge tools:
q chat --trust-tools=fs_read,@infraforge/getDeploymentStatus,@infraforge/getStackOutputs,@infraforge/getOperationManual,@infraforge/listTemplates
-
Use conversational commands:
> List available templates > Deploy a ParallelCluster cluster > Check deployment status
For detailed usage, see User Guide.
InfraForge supports multiple solution configurations organized by category in the configs/ directory:
batch/: AWS Batch solutionsbench/: Benchmarking solutionsdirectoryservice/: Directory Service solutionsec2/: EC2 solutionsecs/: ECS solutionseks/: EKS solutionsenclave/: Enclave solutionshyperpod/: SageMaker HyperPod solutionskafka/: Kafka solutionskudu/: Kudu solutionskubernetes/: Kubernetes solutionsnetbench/: Network benchmarking solutionsparallelcluster/: AWS ParallelCluster solutionsrds/: RDS solutionsredroid/: Redroid solutionsweb3/: Web3 solutions
To create a new solution:
- Identify the appropriate category directory in
configs/or create a new one - Create a new configuration file named
config_<solution>.json - Copy and modify an existing configuration or start from scratch
- To deploy, copy your solution config to
cmd/infraforge/config.json
cdk deploy: Deploy the stack to your default AWS account/regioncdk diff: Compare deployed stack with current statecdk synth: Emit the synthesized CloudFormation templatego test: Run unit testscdk --app ./infraforge deploy: Deploy using InfraForge CDK application
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.