cloud-architect
Architectural guidance for AWS, providing patterns for compute, networking, security, and infrastructure as code.
Install
mkdir -p .claude/skills/cloud-architect-harmitx7 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14183" && unzip -o skill.zip -d .claude/skills/cloud-architect-harmitx7 && rm skill.zipInstalls to .claude/skills/cloud-architect-harmitx7
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Production AWS cloud architecture mastery. Service selection (ECS Fargate vs Lambda vs EC2, RDS vs Aurora vs DynamoDB), Terraform IaC patterns with HCL examples, VPC networking design, IAM least privilege, Secrets Manager, CloudWatch observability, cost optimization, and multi-environment AWS Organizations strategy. Golden Path - AWS. Use when architecting cloud infrastructure, writing Terraform, or making AWS service selection decisions.Key capabilities
- →Select appropriate AWS compute services (ECS Fargate, Lambda, EC2)
- →Choose suitable AWS database services (RDS PostgreSQL, Aurora PostgreSQL, DynamoDB)
- →Design VPC networking with public, private, and data subnets
- →Implement IAM policies following least privilege principles
- →Store secrets using AWS Secrets Manager
- →Configure Terraform state backend with S3 and DynamoDB locking
How it works
The skill provides guidance on AWS service selection, Terraform patterns, VPC design, and security best practices for production cloud architecture.
Inputs & outputs
When to use cloud-architect
- →Design an AWS VPC
- →Write Terraform for ECS
- →Secure an application with IAM
About this skill
Cloud Architect — Production AWS Mastery
Mandatory Pre-Flight Context Inspection
Before architecting AWS cloud infrastructure or writing Terraform HCL, you MUST inspect:
- Dynamic Account ID & Region Resolution (Section 20) → Use
data.aws_caller_identity.current.account_idandvar.region; ban hardcoded account IDs or ARNs - Private Subnet Application Placement (Section 23) → Place application compute (ECS, Lambda) strictly in private subnets; only ALB and NAT Gateway live in public subnets
- Secrets Manager Secret Injection (Section 21) → Reference secret ARNs from AWS Secrets Manager in ECS task definitions; ban plaintext environment variables for passwords/tokens
Hallucination Traps (Read First)
- ❌ Confusing availability zones with regions → ✅
us-east-1is a region.us-east-1ais an AZ within that region. Multi-AZ ≠ multi-region. - ❌
s3:*or*:*IAM policies → ✅ IAM policies must follow least privilege. Enumerate exact actions required. - ❌ Hardcoding ARNs, account IDs, or region strings → ✅ Always use
data.aws_caller_identity.current.account_id,var.region, Terraform variables. - ❌ Storing secrets in environment variables on EC2/ECS → ✅ Use AWS Secrets Manager. Reference ARN in task definition, not plaintext values.
- ❌ Lambda for all compute → ✅ Lambda cold starts hurt latency-sensitive APIs. ECS Fargate for always-warm containers.
- ❌ Public subnets for application servers → ✅ Application tier lives in private subnets. Only ALB and NAT Gateway in public subnets.
Cloud Architect — Production AWS Mastery
1. Service Selection Matrix
Compute
ECS Fargate:
✅ Long-running HTTP services (APIs, web apps)
✅ Container-based workloads (0 server management)
✅ Predictable traffic (no cold start concerns)
✅ >100ms response time acceptable
Cost: ~$0.04048/vCPU/hr + $0.004445/GB/hr
Lambda:
✅ Event-driven (S3 trigger, SQS consumer, API Gateway)
✅ Infrequent, short-duration tasks (<15 min)
✅ True scale-to-zero requirements (cost optimization)
❌ Cold starts (100ms–1s for first request)
❌ Stateful connections (DB connection pooling — use RDS Proxy)
Cost: $0.20/1M requests + $0.0000166667/GB-second
EC2:
✅ Specialized hardware (GPU, high I/O)
✅ Legacy apps that can't containerize
✅ Reserved capacity for cost optimization at scale
❌ Requires patch management and OS maintenance
Cost: Varies, reserved instances 40-60% cheaper than on-demand
Database
RDS PostgreSQL:
✅ ACID transactions required
✅ Complex JOIN queries
✅ Team knows SQL
✅ <10TB data
Multi-AZ: automatic failover in ~60s
Read replicas: up to 5 (async replication)
Aurora PostgreSQL:
✅ RDS PostgreSQL but need: higher availability, faster failover (<30s)
✅ >5 read replicas needed (up to 15 Aurora replicas)
✅ Global database (multi-region reads)
✅ Aurora Serverless v2 for variable/unpredictable load
Cost: ~2x RDS, worth it for high-availability requirements
DynamoDB:
✅ Single-digit ms latency at any scale
✅ Key-value or simple document access patterns
✅ Global tables (multi-region active-active)
✅ Event-driven (DynamoDB Streams → Lambda)
❌ Complex queries (no joins, limited filtering)
❌ Requires careful partition key design
On-Demand pricing: $1.25/1M writes, $0.25/1M reads
2. VPC Architecture (Golden Pattern)
┌─────────────────── VPC (10.0.0.0/16) ────────────────────┐
│ ┌─── Public Subnet A ──┐ ┌─── Public Subnet B ──┐ │
│ │ 10.0.1.0/24 │ │ 10.0.2.0/24 │ │
│ │ - ALB │ │ - ALB (multi-AZ) │ │
│ │ - NAT Gateway │ │ - NAT Gateway │ │
│ └──────────────────────┘ └──────────────────────┘ │
│ ┌─── Private Subnet A ─┐ ┌─── Private Subnet B ─┐ │
│ │ 10.0.11.0/24 │ │ 10.0.12.0/24 │ │
│ │ - ECS Tasks │ │ - ECS Tasks │ │
│ │ - Lambda (VPC) │ │ - Lambda (VPC) │ │
│ └──────────────────────┘ └──────────────────────┘ │
│ ┌─── Data Subnet A ────┐ ┌─── Data Subnet B ────┐ │
│ │ 10.0.21.0/24 │ │ 10.0.22.0/24 │ │
│ │ - RDS Primary │ │ - RDS Replica │ │
│ │ - ElastiCache │ │ - ElastiCache │ │
│ └──────────────────────┘ └──────────────────────┘ │
└───────────────────────────────────────────────────────────┘
Terraform: VPC Module
# modules/networking/main.tf
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.0"
name = "${var.project}-${var.environment}"
cidr = var.vpc_cidr # e.g., "10.0.0.0/16"
azs = data.aws_availability_zones.available.names
public_subnets = var.public_subnet_cidrs # ["10.0.1.0/24", "10.0.2.0/24"]
private_subnets = var.private_subnet_cidrs # ["10.0.11.0/24", "10.0.12.0/24"]
database_subnets = var.database_subnet_cidrs # ["10.0.21.0/24", "10.0.22.0/24"]
enable_nat_gateway = true
single_nat_gateway = var.environment == "staging" # save cost in staging
enable_dns_hostnames = true
enable_dns_support = true
# Required for ECS/EKS
public_subnet_tags = {
"kubernetes.io/role/elb" = 1
}
private_subnet_tags = {
"kubernetes.io/role/internal-elb" = 1
}
tags = local.common_tags
}
3. ECS Fargate Service (Complete Terraform)
# modules/ecs/main.tf
# Cluster
resource "aws_ecs_cluster" "main" {
name = "${var.project}-${var.environment}"
setting {
name = "containerInsights"
value = "enabled" # CloudWatch Container Insights
}
tags = local.common_tags
}
# Task Definition
resource "aws_ecs_task_definition" "api" {
family = "${var.project}-api"
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
cpu = var.task_cpu # e.g., 512 (0.5 vCPU)
memory = var.task_memory # e.g., 1024 (1 GB)
execution_role_arn = aws_iam_role.ecs_execution.arn
task_role_arn = aws_iam_role.ecs_task.arn
container_definitions = jsonencode([{
name = "api"
image = "${var.ecr_repository_url}:${var.image_tag}"
portMappings = [{
containerPort = var.container_port
protocol = "tcp"
}]
# ✅ Secrets from Secrets Manager (not plaintext env vars)
secrets = [
{ name = "DATABASE_URL", valueFrom = aws_secretsmanager_secret.db_url.arn },
{ name = "JWT_SECRET", valueFrom = aws_secretsmanager_secret.jwt.arn }
]
environment = [
{ name = "NODE_ENV", value = var.environment },
{ name = "PORT", value = tostring(var.container_port) }
]
logConfiguration = {
logDriver = "awslogs"
options = {
"awslogs-group" = aws_cloudwatch_log_group.api.name
"awslogs-region" = var.aws_region
"awslogs-stream-prefix" = "api"
}
}
healthCheck = {
command = ["CMD-SHELL", "wget --quiet --tries=1 --spider http://localhost:${var.container_port}/health || exit 1"]
interval = 30
timeout = 5
retries = 3
startPeriod = 10
}
}])
tags = local.common_tags
}
# ECS Service
resource "aws_ecs_service" "api" {
name = "${var.project}-api"
cluster = aws_ecs_cluster.main.id
task_definition = aws_ecs_task_definition.api.arn
desired_count = var.desired_count
launch_type = "FARGATE"
network_configuration {
subnets = module.vpc.private_subnets
security_groups = [aws_security_group.api.id]
assign_public_ip = false # ✅ private subnets never get public IPs
}
load_balancer {
target_group_arn = aws_lb_target_group.api.arn
container_name = "api"
container_port = var.container_port
}
deployment_configuration {
maximum_percent = 200
minimum_healthy_percent = 50
deployment_circuit_breaker {
enable = true
rollback = true # auto-rollback on failure
}
}
depends_on = [aws_lb_listener.https]
tags = local.common_tags
}
4. IAM Least Privilege
# ✅ Execution Role — what ECS needs to START your container
resource "aws_iam_role" "ecs_execution" {
name = "${var.project}-ecs-execution"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Effect = "Allow"
Principal = { Service = "ecs-tasks.amazonaws.com" }
Action = "sts:AssumeRole"
}]
})
}
resource "aws_iam_role_policy_attachment" "ecs_execution_managed" {
role = aws_iam_role.ecs_execution.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
}
# Allow pulling secrets from Secrets Manager
resource "aws_iam_role_policy" "ecs_execution_secrets" {
name = "secrets-access"
role = aws_iam_role.ecs_execution.id
policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Effect = "Allow"
Action = ["secretsmanager:GetSecretValue"]
Resource = [
aws_secretsmanager_secret.db_url.arn,
aws_secretsmanager_secret.jwt.arn
]
# ✅ Scoped to exact secret ARNs, not secretsmanager:*
}]
})
}
# ✅ Task Role — what your APPLICATION code can do at runtime
resource "aws_iam_role_policy" "ecs_task_app" {
name = "app-permissions"
role = aws_iam_role.ecs_task.id
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = ["s3:GetObject", "s3:PutObject"]
Resource = "${aws_s3_bucket.uploads.arn}/*"
# ✅ Specific bucket, specific actions — not s3:*
},
{
Effect = "Allow"
Action = ["ses:SendEmail"]
Resource = "arn:aws:ses:${var.aws_region}:${data.aws_caller_identity.current.account_id}:identity/*"
}
]
})
}
5. CloudWatch Observability
# Structured JSON logging — filter patterns work
resource "aws_cloudwatch_l
---
*Content truncated.*
When not to use it
- →When architecting cloud infrastructure outside of AWS
- →When the project does not involve Terraform
- →When hardcoding ARNs, account IDs, or region strings
Limitations
- →The skill is specific to AWS cloud architecture.
- →The skill emphasizes Terraform for Infrastructure as Code.
- →The skill provides specific cost considerations for AWS services.
How it compares
This skill offers a structured approach to AWS cloud architecture with specific service recommendations and Terraform examples, providing a 'Golden Path' unlike a generic cloud design process.
Compared to similar skills
cloud-architect side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| cloud-architect (this skill) | 0 | 1mo | Review | Advanced |
| aws-solution-architect | 20 | 3mo | Review | Advanced |
| terraform-module-library | 7 | 4mo | No flags | Advanced |
| aws-advisor | 5 | 5mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Harmitx7
View all by Harmitx7 →You might also like
aws-solution-architect
alirezarezvani
Design AWS architectures for startups using serverless patterns and IaC templates. Use when asked to design serverless architecture, create CloudFormation templates, optimize AWS costs, set up CI/CD pipelines, or migrate to AWS. Covers Lambda, API Gateway, DynamoDB, ECS, Aurora, and cost optimization.
terraform-module-library
wshobson
Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.
aws-advisor
tech-leads-club
Expert AWS Cloud Advisor for architecture design, security review, and implementation guidance. Leverages AWS MCP tools for accurate, documentation-backed answers. Use when user asks about AWS architecture, security, service selection, migrations, troubleshooting, or learning AWS. Triggers on AWS, Lambda, S3, EC2, ECS, EKS, DynamoDB, RDS, CloudFormation, CDK, Terraform, Serverless, SAM, IAM, VPC, API Gateway, or any AWS service.
devops-iac-engineer
davila7
Implements infrastructure as code using Terraform, Kubernetes, and cloud platforms. Designs scalable architectures, CI/CD pipelines, and observability solutions. Provides security-first DevOps practices and site reliability engineering guidance.
hybrid-cloud-networking
wshobson
Configure secure, high-performance connectivity between on-premises infrastructure and cloud platforms using VPN and dedicated connections. Use when building hybrid cloud architectures, connecting data centers to cloud, or implementing secure cross-premises networking.
aws-skills
Anhvu1107
ALWAYS use this when the request matches AWS Skills: AWS development with infrastructure automation and cloud architecture patterns