Cloud Infrastructure
Design and provision cloud infrastructure with AWS-primary patterns and cloud-agnostic naming for portability.
Decision Framework
New service/workload?
├── Stateless, event-driven, <15min → Serverless (Lambda + API GW)
├── Long-running, stateful, predictable → Containers (ECS Fargate)
├── Kubernetes-native, multi-cloud → Orchestration (EKS)
└── Static content, CDN → Storage (S3 + CloudFront)
Database needs?
├── Key-value, <1ms, scale-to-zero → DynamoDB
├── Relational, complex queries → RDS/Aurora
├── Document store, flexible schema → DocumentDB
└── Cache, sessions, pub/sub → ElastiCache (Redis)
IaC approach?
├── AWS-only, type-safe → CDK (TypeScript)
├── Multi-cloud, declarative → Terraform
└── Simple, YAML → CloudFormation
When NOT to Use
- CI/CD pipelines: Use
ci-cd skill for pipeline config (CodePipeline, GitHub Actions)
- Database schema design: Use
database-design skill for schema/migrations/queries
- Application-level monitoring: Use
observability skill for application metrics/logs/traces
References
| File |
Use When |
references/service-selection.md |
Choosing between AWS compute, database, or messaging services |
references/cdk-patterns.md |
Writing CDK constructs, organizing stacks, L1/L2/L3 patterns |
references/serverless-patterns.md |
Building Lambda functions, API Gateway, Step Functions, event-driven |
references/container-patterns.md |
ECS Fargate task definitions, service discovery, health checks |
references/iam-and-security.md |
IAM policies, security groups, VPC design, least privilege |
references/storage-and-cdn.md |
S3 configuration, CloudFront distributions, caching strategies |
references/database-selection.md |
DynamoDB patterns, RDS/Aurora configuration, managed DB comparison |
references/cost-optimization.md |
Right-sizing, reserved capacity, cost estimation, billing alerts |
Runtime Notes
- Claude Code: dispatch yokay-implementer via the Task tool with
subagent_type: "pokayokay:yokay-implementer".
- Codex: there is no subagent dispatch. Execute the agent's role inline — read the corresponding
agents/yokay-<name>.md and follow its Behavioral Defaults, Critical Rules, and Output Contract directly in the current session.
1---2name: cloud-infrastructure3description: Use when provisioning cloud resources, choosing between AWS services (Lambda vs ECS vs EKS), writing CDK/IaC, designing serverless or container architectures, configuring IAM/security groups, or optimizing cloud costs.4---5
6# Cloud Infrastructure
7
8Design and provision cloud infrastructure with AWS-primary patterns and cloud-agnostic naming for portability.
9
10## Decision Framework
11
12```
13New service/workload?
14├── Stateless, event-driven, <15min → Serverless (Lambda + API GW)
15├── Long-running, stateful, predictable → Containers (ECS Fargate)
16├── Kubernetes-native, multi-cloud → Orchestration (EKS)
17└── Static content, CDN → Storage (S3 + CloudFront)
18
19Database needs?
20├── Key-value, <1ms, scale-to-zero → DynamoDB
21├── Relational, complex queries → RDS/Aurora
22├── Document store, flexible schema → DocumentDB
23└── Cache, sessions, pub/sub → ElastiCache (Redis)
24
25IaC approach?
26├── AWS-only, type-safe → CDK (TypeScript)
27├── Multi-cloud, declarative → Terraform
28└── Simple, YAML → CloudFormation
29```
30
31## When NOT to Use
32
33- **CI/CD pipelines**: Use `ci-cd` skill for pipeline config (CodePipeline, GitHub Actions)
34- **Database schema design**: Use `database-design` skill for schema/migrations/queries
35- **Application-level monitoring**: Use `observability` skill for application metrics/logs/traces
36
37## References
38
39| File | Use When |
40|------|----------|
41| `references/service-selection.md` | Choosing between AWS compute, database, or messaging services |
42| `references/cdk-patterns.md` | Writing CDK constructs, organizing stacks, L1/L2/L3 patterns |
43| `references/serverless-patterns.md` | Building Lambda functions, API Gateway, Step Functions, event-driven |
44| `references/container-patterns.md` | ECS Fargate task definitions, service discovery, health checks |
45| `references/iam-and-security.md` | IAM policies, security groups, VPC design, least privilege |
46| `references/storage-and-cdn.md` | S3 configuration, CloudFront distributions, caching strategies |
47| `references/database-selection.md` | DynamoDB patterns, RDS/Aurora configuration, managed DB comparison |
48| `references/cost-optimization.md` | Right-sizing, reserved capacity, cost estimation, billing alerts |
49
50## Runtime Notes
51
52- **Claude Code**: dispatch yokay-implementer via the Task tool with `subagent_type: "pokayokay:yokay-implementer"`.
53- **Codex**: there is no subagent dispatch. Execute the agent's role inline — read the corresponding `agents/yokay-<name>.md` and follow its Behavioral Defaults, Critical Rules, and Output Contract directly in the current session.