AWS 架构设计与优化
aws-architecture-design
目的:标准化 stakpak 设计和优化 AWS 架构的方式。 范围: 全新项目(Greenfield):设计新基础设施。 存量项目(Brownfield):分析现有架构并提出改进建议。
- License 许可
- MIT
- 最近更新
- 2026-07-04
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- aws-architecture-design
- tags
- [ "aws", "architecture", "design aws architecture", "optimize aws architecture" ]
- license
- MIT
- metadata
- { "author": "Stakpak <team@stakpak.dev>", "version": "1.0.2" }
- description
- Purpose: Standardize how stakpak designs and optimizes AWS architectures. Scope: Greenfield: design new infrastructure. Brownfield: analyze existing architectures and propose improvements.
03 SKILL.md 正文
Designing & Optimizing AWS Architectures Rule Book
Overview
Purpose: Standardize how the agent designs and optimizes AWS architectures.
Scope:
- Greenfield: design new infrastructure.
- Brownfield: analyze existing architectures and propose improvements.
Reference Frameworks:
- AWS Well-Architected Framework (WAF)
- Well-Architected Lenses (Serverless, SaaS, ML, etc.)
Phases
- Discover: gather requirements / current context.
- Design: propose new architecture.
- Review: map an existing system against Well-Architected.
- Optimize: recommend improvements.
Workflow
Step 1: Context Gathering
- Start by clarifying whether the goal is to design a new infrastructure or optimize an existing one.
- If it's new, focus first on the core objective (what the system needs to achieve). Other details like constraints and workloads can be explored gradually as the design unfolds.
- For existing environments, first locate the infrastructure (accounts, regions, IaC repositories). From there, review the supporting assets such as IaC definitions, diagrams, monitoring data, and cost reports.
Step 2: Requirements Definition
- Functional (APIs, batch jobs, analytics).
- Non-functional (availability, performance, security, compliance, cost).
Step 3: Architecture Mapping
-
Match requirements to AWS services (compute, storage, networking, database).
-
Consider Serverless-first designs when applicable:
-
Compute → Lambda, Step Functions, Fargate
-
API → API Gateway + AppSync
-
Storage → S3, DynamoDB
-
Messaging → SNS, SQS, EventBridge
-
Security → IAM, Cognito, WAF, KMS
-
Step 4: Well-Architected Review
-
5 Pillars Checklist
-
Operational Excellence: monitoring, IaC, automation.
-
Security: IAM least privilege, encryption, threat detection.
-
Reliability: HA, backup/restore, fault isolation.
-
Performance Efficiency: caching, scaling, right-sizing.
-
Cost Optimization: Spot, RIs, lifecycle rules, serverless.
-
-
Serverless Lens Focus:
-
Minimize undifferentiated ops.
-
Event-driven orchestration (Step Functions/EventBridge).
-
Use managed data stores (DynamoDB, Aurora Serverless).
-
Secure with IAM boundaries, managed identity (Cognito).
-
Step 5: Proposal / Optimization
-
Draft architecture diagram.
-
For existing → generate recommendations table: Pillar, Current Gap, Recommendation, Expected Impact
Step 6: Validation
-
Risks & mitigations.
-
Cost estimates (before/after).
-
Load test strategy
Step 7: Report
-
Write everything into Markdown architecture file.
-
Include: Overview, Requirements, Architecture, Diagrams, Well-Architected Review, Optimizations, Risks, Costs.
Security References
1. Identity & Access
-
Enforce least privilege IAM policies.
-
Prefer IAM roles over static keys.
-
Use ABAC or RBAC (tags, groups, accounts) for scalable access control.
-
Require MFA for privileged accounts.
-
Use AWS SSO / IAM Identity Center for central identity management.
2. Data Protection
-
Encrypt all data at rest (S3, EBS, RDS, DynamoDB, etc.) with KMS CMKs.
-
Encrypt all data in transit (TLS 1.2+).
-
Enable S3 Block Public Access and least privilege bucket policies.
-
Use Secrets Manager / Parameter Store — no hardcoded credentials.
3. Network Security
-
Use VPC with private subnets for workloads.
-
Restrict inbound/outbound traffic with Security Groups and NACLs.
-
Use VPC Endpoints for private service access (no public internet).
-
Add WAF/Shield for public-facing endpoints.
-
Prefer ALB/NLB with TLS termination over exposing EC2 directly.
4. Monitoring & Logging
-
Enable CloudTrail in all regions and send logs to a centralized S3 bucket.
-
Enable Config Rules for compliance enforcement.
-
Integrate GuardDuty, Security Hub, Inspector for threat detection.
-
Centralize logs (CloudWatch Logs / OpenSearch) and set retention policies.
-
Use CloudWatch alarms for anomalies, cost spikes, security events.
5. Resilience & Recovery
-
Apply multi-AZ deployments for critical data stores.
-
Enforce automated backups with retention policies.
-
Test disaster recovery scenarios (RTO/RPO compliance).
-
Use infrastructure as code (Terraform/CDK/CloudFormation) to rebuild environments securely.
6. Governance & Compliance
-
Apply service control policies (SCPs) with AWS Organizations.
-
Enforce tagging standards for resources (cost, owner, env).
-
Align with compliance frameworks (ISO, SOC2, HIPAA, GDPR) when required.
-
Use Trusted Advisor and Well-Architected Tool for regular reviews.
Cost References
- Native Cost Tools First: Use cloud provider billing tools as primary source
- Credits Excluded: Always exclude credits unless analyzing discount impact
- Comprehensive Discovery: Identify ALL infrastructure components
- Current Pricing: Research real-time standard pricing only
- Python Calculations: Use Python for ALL numeric operations
NOTE: Dont implement anything until you generate the report and ask for my permission
04 同仓库更多 Skills
vLLM 高性能推理部署
vllm-deployment
部署 vLLM 以实现高性能 LLM 推理。涵盖 Docker 的 CPU/GPU 部署、云虚拟机配置以及 OpenAI 兼容的 API 端点。
Terrateam 配置与使用指南
terrateam-usage-guide
配置和使用 Terrateam 的综合指南。Terrateam 是一个用于 Terraform 和 OpenTofu 的开源 GitOps CI/CD 平台。涵盖配置文件结构、访问控制、工作流、OIDC 身份验证、漂移检测以及通过拉取请求(Pull Request)管理基础设施的最佳实践。
云虚拟机安全部署
simple-deployment-on-vm
如何在不同云提供商的虚拟机上进行简单但安全的部署
Next.js 应用 AWS 部署方案对比
nextjs-on-aws
本文档比较了 Next.js 应用的各种 AWS 部署方案,分析其成本、优势和局限性,并针对不同使用场景给出建议。
Bitnami 图表与镜像迁移至 Legacy
migrating-bitnami-to-bitnami-legacy
本规则手册帮助你将 Bitnami Helm charts(图表)和容器镜像从 bitnami 仓库迁移到 bitnamilegacy 仓库。 由于 Bitnami 的过渡调整(自 2025 年 8 月 28 日起生效),现有镜像将被移至 legacy 仓库,因此此次迁移十分必要。
K3s 集群备份与恢复
k3s-backup
面向 K3s 集群的备份与恢复方案。包括定时备份、关机前备份和手动备份策略,以及相应的恢复流程。