@@ -8,16 +8,87 @@ The Kainos Studio infrastructure implements a multi-tier network architecture wi
88
99## 🟠 AWS Network Architecture
1010
11+ ### Domain and URL Configuration
12+
13+ | Environment | Domain/URL | SSL Certificate | Purpose |
14+ | -------------| ------------| -----------------| ---------|
15+ | ** Development** | ` https://dev.core.kainos-studio.com/ ` | Wildcard SSL | Development testing |
16+ | ** Staging** | ` https://staging.core.kainos-studio.com/ ` | Wildcard SSL | Pre-production validation |
17+ | ** Production** | ` https://core.kainos-studio.com/ ` | Dedicated SSL | Live production service |
18+
19+ #### DNS Configuration
20+ ``` hcl
21+ # Development
22+ resource "aws_route53_record" "dev" {
23+ zone_id = var.hosted_zone_id
24+ name = "dev.core.kainos-studio.com"
25+ type = "A"
26+
27+ alias {
28+ name = aws_cloudfront_distribution.dev.domain_name
29+ zone_id = aws_cloudfront_distribution.dev.hosted_zone_id
30+ evaluate_target_health = false
31+ }
32+ }
33+
34+ # Staging
35+ resource "aws_route53_record" "staging" {
36+ zone_id = var.hosted_zone_id
37+ name = "staging.core.kainos-studio.com"
38+ type = "A"
39+
40+ alias {
41+ name = aws_cloudfront_distribution.staging.domain_name
42+ zone_id = aws_cloudfront_distribution.staging.hosted_zone_id
43+ evaluate_target_health = false
44+ }
45+ }
46+
47+ # Production
48+ resource "aws_route53_record" "prod" {
49+ zone_id = var.hosted_zone_id
50+ name = "core.kainos-studio.com"
51+ type = "A"
52+
53+ alias {
54+ name = aws_cloudfront_distribution.prod.domain_name
55+ zone_id = aws_cloudfront_distribution.prod.hosted_zone_id
56+ evaluate_target_health = false
57+ }
58+ }
59+ ```
60+
61+ ### Account Structure
62+
63+ | Environment | AWS Account | Purpose |
64+ | -------------| -------------| ---------|
65+ | ** Development** | Shared Account | Development and testing |
66+ | ** Staging** | Shared Account | Pre-production validation |
67+ | ** Production** | Dedicated Account | Production workloads with enhanced security |
68+
1169### VPC Design
1270
71+ #### Development and Staging (Shared Account)
1372| Component | Configuration | Purpose |
1473| -----------| ---------------| ---------|
1574| ** VPC CIDR** | 10.0.0.0/16 | Main network space |
16- | ** Availability Zones** | 3 AZs minimum | High availability |
75+ | ** Availability Zones** | 2-3 AZs | High availability |
76+ | ** DNS Resolution** | Enabled | Service discovery |
77+ | ** DNS Hostnames** | Enabled | Resource naming |
78+
79+ #### Production (Dedicated Account)
80+ | Component | Configuration | Purpose |
81+ | -----------| ---------------| ---------|
82+ | ** VPC CIDR** | 10.1.0.0/16 | Isolated production network |
83+ | ** Availability Zones** | 3 AZs minimum | Maximum availability |
1784| ** DNS Resolution** | Enabled | Service discovery |
1885| ** DNS Hostnames** | Enabled | Resource naming |
86+ | ** Flow Logs** | Enabled to S3 | Enhanced monitoring |
87+ | ** VPC Peering** | Cross-account if needed | Secure connectivity |
1988
2089#### VPC Configuration
90+
91+ ##### Development/Staging VPC
2192``` hcl
2293resource "aws_vpc" "kainos_core" {
2394 cidr_block = "10.0.0.0/16"
@@ -27,18 +98,55 @@ resource "aws_vpc" "kainos_core" {
2798 tags = {
2899 Name = "kainos-core-vpc-${var.environment}"
29100 Environment = var.environment
101+ Account = "shared"
102+ }
103+ }
104+ ```
105+
106+ ##### Production VPC
107+ ``` hcl
108+ resource "aws_vpc" "kainos_core_prod" {
109+ cidr_block = "10.1.0.0/16"
110+ enable_dns_hostnames = true
111+ enable_dns_support = true
112+
113+ tags = {
114+ Name = "kainos-core-vpc-prod"
115+ Environment = "production"
116+ Account = "dedicated"
117+ }
118+ }
119+
120+ # Enhanced Flow Logs for Production
121+ resource "aws_flow_log" "prod_vpc" {
122+ iam_role_arn = aws_iam_role.flow_log.arn
123+ log_destination = aws_s3_bucket.flow_logs.arn
124+ traffic_type = "ALL"
125+ vpc_id = aws_vpc.kainos_core_prod.id
126+
127+ tags = {
128+ Name = "kainos-core-prod-flow-logs"
30129 }
31130}
32131```
33132
34133### Subnet Architecture
35134
135+ #### Development and Staging (Shared Account)
36136| Subnet Type | CIDR Blocks | Purpose | Internet Access |
37137| -------------| -------------| ---------| -----------------|
38138| ** Public Subnets** | 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24 | NAT Gateways, Load Balancers | Direct |
39139| ** Private Subnets** | 10.0.11.0/24, 10.0.12.0/24, 10.0.13.0/24 | Lambda functions, RDS | Via NAT |
40140| ** Database Subnets** | 10.0.21.0/24, 10.0.22.0/24, 10.0.23.0/24 | Database instances | None |
41141
142+ #### Production (Dedicated Account)
143+ | Subnet Type | CIDR Blocks | Purpose | Internet Access |
144+ | -------------| -------------| ---------| -----------------|
145+ | ** Public Subnets** | 10.1.1.0/24, 10.1.2.0/24, 10.1.3.0/24 | NAT Gateways, Load Balancers | Direct |
146+ | ** Private Subnets** | 10.1.11.0/24, 10.1.12.0/24, 10.1.13.0/24 | Lambda functions, RDS | Via NAT |
147+ | ** Database Subnets** | 10.1.21.0/24, 10.1.22.0/24, 10.1.23.0/24 | Database instances | None |
148+ | ** Management Subnets** | 10.1.31.0/24, 10.1.32.0/24, 10.1.33.0/24 | Bastion hosts, monitoring | Restricted |
149+
42150#### Subnet Configuration
43151``` hcl
44152# Public Subnets
@@ -431,13 +539,22 @@ resource "aws_flow_log" "vpc" {
431539
432540### Pre-deployment Security
433541
542+ #### Development and Staging
434543- [ ] VPC/VNet CIDR doesn't overlap with existing networks
435544- [ ] Security groups/NSGs follow least privilege principle
436545- [ ] NACLs configured for defense in depth
437546- [ ] VPC endpoints/Private endpoints configured for AWS/Azure services
438547- [ ] Flow logs enabled for network monitoring
439548- [ ] DNS resolution properly configured
440549
550+ #### Production (Additional Requirements)
551+ - [ ] Dedicated AWS account with isolated networking
552+ - [ ] Enhanced VPC Flow Logs to S3 with encryption
553+ - [ ] Cross-account IAM roles configured securely
554+ - [ ] Network monitoring and alerting configured
555+ - [ ] Bastion host access properly configured
556+ - [ ] Management subnet access restricted to authorized personnel
557+
441558### Post-deployment Security
442559
443560- [ ] Network connectivity tested from all subnets
0 commit comments