[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-c78da4af-20a2-4533-9ed3-6f46eea72701":3,"$fgHUQ8TcA0ABAF52hcHZzytYZd_3yDn5Q3RNAesjc8rs":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"c78da4af-20a2-4533-9ed3-6f46eea72701","aws-solution-architect","为初创公司设计使用无服务器模式和IaC模板的AWS架构。在需要设计无服务器架构、创建CloudFormation模板、优化AWS成本、设置CI\u002FCD管道或迁移到AWS时使用。涵盖Lambda、API Gateway、DynamoDB、ECS、Aurora和成本优化。","cat_coding_devops","mod_coding","alirezarezvani,coding","---\nname: \"aws-solution-architect\"\ndescription: 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\u002FCD pipelines, or migrate to AWS. Covers Lambda, API Gateway, DynamoDB, ECS, Aurora, and cost optimization.\n---\n\n# AWS Solution Architect\n\nDesign scalable, cost-effective AWS architectures for startups with infrastructure-as-code templates.\n\n---\n\n## Workflow\n\n### Step 1: Gather Requirements\n\nCollect application specifications:\n\n```\n- Application type (web app, mobile backend, data pipeline, SaaS)\n- Expected users and requests per second\n- Budget constraints (monthly spend limit)\n- Team size and AWS experience level\n- Compliance requirements (GDPR, HIPAA, SOC 2)\n- Availability requirements (SLA, RPO\u002FRTO)\n```\n\n### Step 2: Design Architecture\n\nRun the architecture designer to get pattern recommendations:\n\n```bash\npython scripts\u002Farchitecture_designer.py --input requirements.json\n```\n\n**Example output:**\n\n```json\n{\n  \"recommended_pattern\": \"serverless_web\",\n  \"service_stack\": [\"S3\", \"CloudFront\", \"API Gateway\", \"Lambda\", \"DynamoDB\", \"Cognito\"],\n  \"estimated_monthly_cost_usd\": 35,\n  \"pros\": [\"Low ops overhead\", \"Pay-per-use\", \"Auto-scaling\"],\n  \"cons\": [\"Cold starts\", \"15-min Lambda limit\", \"Eventual consistency\"]\n}\n```\n\nSelect from recommended patterns:\n- **Serverless Web**: S3 + CloudFront + API Gateway + Lambda + DynamoDB\n- **Event-Driven Microservices**: EventBridge + Lambda + SQS + Step Functions\n- **Three-Tier**: ALB + ECS Fargate + Aurora + ElastiCache\n- **GraphQL Backend**: AppSync + Lambda + DynamoDB + Cognito\n\nSee `references\u002Farchitecture_patterns.md` for detailed pattern specifications.\n\n**Validation checkpoint:** Confirm the recommended pattern matches the team's operational maturity and compliance requirements before proceeding to Step 3.\n\n### Step 3: Generate IaC Templates\n\nCreate infrastructure-as-code for the selected pattern:\n\n```bash\n# Serverless stack (CloudFormation)\npython scripts\u002Fserverless_stack.py --app-name my-app --region us-east-1\n```\n\n**Example CloudFormation YAML output (core serverless resources):**\n\n```yaml\nAWSTemplateFormatVersion: '2010-09-09'\nTransform: AWS::Serverless-2016-10-31\n\nParameters:\n  AppName:\n    Type: String\n    Default: my-app\n\nResources:\n  ApiFunction:\n    Type: AWS::Serverless::Function\n    Properties:\n      Handler: index.handler\n      Runtime: nodejs20.x\n      MemorySize: 512\n      Timeout: 30\n      Environment:\n        Variables:\n          TABLE_NAME: !Ref DataTable\n      Policies:\n        - DynamoDBCrudPolicy:\n            TableName: !Ref DataTable\n      Events:\n        ApiEvent:\n          Type: Api\n          Properties:\n            Path: \u002F{proxy+}\n            Method: ANY\n\n  DataTable:\n    Type: AWS::DynamoDB::Table\n    Properties:\n      BillingMode: PAY_PER_REQUEST\n      AttributeDefinitions:\n        - AttributeName: pk\n          AttributeType: S\n        - AttributeName: sk\n          AttributeType: S\n      KeySchema:\n        - AttributeName: pk\n          KeyType: HASH\n        - AttributeName: sk\n          KeyType: RANGE\n```\n\n> Full templates including API Gateway, Cognito, IAM roles, and CloudWatch logging are generated by `serverless_stack.py` and also available in `references\u002Farchitecture_patterns.md`.\n\n**Example CDK TypeScript snippet (three-tier pattern):**\n\n```typescript\nimport * as ecs from 'aws-cdk-lib\u002Faws-ecs';\nimport * as ec2 from 'aws-cdk-lib\u002Faws-ec2';\nimport * as rds from 'aws-cdk-lib\u002Faws-rds';\n\nconst vpc = new ec2.Vpc(this, 'AppVpc', { maxAzs: 2 });\n\nconst cluster = new ecs.Cluster(this, 'AppCluster', { vpc });\n\nconst db = new rds.ServerlessCluster(this, 'AppDb', {\n  engine: rds.DatabaseClusterEngine.auroraPostgres({\n    version: rds.AuroraPostgresEngineVersion.VER_15_2,\n  }),\n  vpc,\n  scaling: { minCapacity: 0.5, maxCapacity: 4 },\n});\n```\n\n### Step 4: Review Costs\n\nAnalyze estimated costs and optimization opportunities:\n\n```bash\npython scripts\u002Fcost_optimizer.py --resources current_setup.json --monthly-spend 2000\n```\n\n**Example output:**\n\n```json\n{\n  \"current_monthly_usd\": 2000,\n  \"recommendations\": [\n    { \"action\": \"Right-size RDS db.r5.2xlarge → db.r5.large\", \"savings_usd\": 420, \"priority\": \"high\" },\n    { \"action\": \"Purchase 1-yr Compute Savings Plan at 40% utilization\", \"savings_usd\": 310, \"priority\": \"high\" },\n    { \"action\": \"Move S3 objects >90 days to Glacier Instant Retrieval\", \"savings_usd\": 85, \"priority\": \"medium\" }\n  ],\n  \"total_potential_savings_usd\": 815\n}\n```\n\nOutput includes:\n- Monthly cost breakdown by service\n- Right-sizing recommendations\n- Savings Plans opportunities\n- Potential monthly savings\n\n### Step 5: Deploy\n\nDeploy the generated infrastructure:\n\n```bash\n# CloudFormation\naws cloudformation create-stack \\\n  --stack-name my-app-stack \\\n  --template-body file:\u002F\u002Ftemplate.yaml \\\n  --capabilities CAPABILITY_IAM\n\n# CDK\ncdk deploy\n\n# Terraform\nterraform init && terraform apply\n```\n\n### Step 6: Validate and Handle Failures\n\nVerify deployment and set up monitoring:\n\n```bash\n# Check stack status\naws cloudformation describe-stacks --stack-name my-app-stack\n\n# Set up CloudWatch alarms\naws cloudwatch put-metric-alarm --alarm-name high-errors ...\n```\n\n**If stack creation fails:**\n\n1. Check the failure reason:\n   ```bash\n   aws cloudformation describe-stack-events \\\n     --stack-name my-app-stack \\\n     --query 'StackEvents[?ResourceStatus==`CREATE_FAILED`]'\n   ```\n2. Review CloudWatch Logs for Lambda or ECS errors.\n3. Fix the template or resource configuration.\n4. Delete the failed stack before retrying:\n   ```bash\n   aws cloudformation delete-stack --stack-name my-app-stack\n   # Wait for deletion\n   aws cloudformation wait stack-delete-complete --stack-name my-app-stack\n   # Redeploy\n   aws cloudformation create-stack ...\n   ```\n\n**Common failure causes:**\n- IAM permission errors → verify `--capabilities CAPABILITY_IAM` and role trust policies\n- Resource limit exceeded → request quota increase via Service Quotas console\n- Invalid template syntax → run `aws cloudformation validate-template --template-body file:\u002F\u002Ftemplate.yaml` before deploying\n\n---\n\n## Tools\n\n### architecture_designer.py\n\nGenerates architecture patterns based on requirements.\n\n```bash\npython scripts\u002Farchitecture_designer.py --input requirements.json --output design.json\n```\n\n**Input:** JSON with app type, scale, budget, compliance needs\n**Output:** Recommended pattern, service stack, cost estimate, pros\u002Fcons\n\n### serverless_stack.py\n\nCreates serverless CloudFormation templates.\n\n```bash\npython scripts\u002Fserverless_stack.py --app-name my-app --region us-east-1\n```\n\n**Output:** Production-ready CloudFormation YAML with:\n- API Gateway + Lambda\n- DynamoDB table\n- Cognito user pool\n- IAM roles with least privilege\n- CloudWatch logging\n\n### cost_optimizer.py\n\nAnalyzes costs and recommends optimizations.\n\n```bash\npython scripts\u002Fcost_optimizer.py --resources inventory.json --monthly-spend 5000\n```\n\n**Output:** Recommendations for:\n- Idle resource removal\n- Instance right-sizing\n- Reserved capacity purchases\n- Storage tier transitions\n- NAT Gateway alternatives\n\n---\n\n## Quick Start\n\n### MVP Architecture (\u003C $100\u002Fmonth)\n\n```\nAsk: \"Design a serverless MVP backend for a mobile app with 1000 users\"\n\nResult:\n- Lambda + API Gateway for API\n- DynamoDB pay-per-request for data\n- Cognito for authentication\n- S3 + CloudFront for static assets\n- Estimated: $20-50\u002Fmonth\n```\n\n### Scaling Architecture ($500-2000\u002Fmonth)\n\n```\nAsk: \"Design a scalable architecture for a SaaS platform with 50k users\"\n\nResult:\n- ECS Fargate for containerized API\n- Aurora Serverless for relational data\n- ElastiCache for session caching\n- CloudFront for CDN\n- CodePipeline for CI\u002FCD\n- Multi-AZ deployment\n```\n\n### Cost Optimization\n\n```\nAsk: \"Optimize my AWS setup to reduce costs by 30%. Current spend: $3000\u002Fmonth\"\n\nProvide: Current resource inventory (EC2, RDS, S3, etc.)\n\nResult:\n- Idle resource identification\n- Right-sizing recommendations\n- Savings Plans analysis\n- Storage lifecycle policies\n- Target savings: $900\u002Fmonth\n```\n\n### IaC Generation\n\n```\nAsk: \"Generate CloudFormation for a three-tier web app with auto-scaling\"\n\nResult:\n- VPC with public\u002Fprivate subnets\n- ALB with HTTPS\n- ECS Fargate with auto-scaling\n- Aurora with read replicas\n- Security groups and IAM roles\n```\n\n---\n\n## Input Requirements\n\nProvide these details for architecture design:\n\n| Requirement | Description | Example |\n|-------------|-------------|---------|\n| Application type | What you're building | SaaS platform, mobile backend |\n| Expected scale | Users, requests\u002Fsec | 10k users, 100 RPS |\n| Budget | Monthly AWS limit | $500\u002Fmonth max |\n| Team context | Size, AWS experience | 3 devs, intermediate |\n| Compliance | Regulatory needs | HIPAA, GDPR, SOC 2 |\n| Availability | Uptime requirements | 99.9% SLA, 1hr RPO |\n\n**JSON Format:**\n\n```json\n{\n  \"application_type\": \"saas_platform\",\n  \"expected_users\": 10000,\n  \"requests_per_second\": 100,\n  \"budget_monthly_usd\": 500,\n  \"team_size\": 3,\n  \"aws_experience\": \"intermediate\",\n  \"compliance\": [\"SOC2\"],\n  \"availability_sla\": \"99.9%\"\n}\n```\n\n---\n\n## Output Formats\n\n### Architecture Design\n\n- Pattern recommendation with rationale\n- Service stack diagram (ASCII)\n- Monthly cost estimate and trade-offs\n\n### IaC Templates\n\n- **CloudFormation YAML**: Production-ready SAM\u002FCFN templates\n- **CDK TypeScript**: Type-safe infrastructure code\n- **Terraform HCL**: Multi-cloud compatible configs\n\n### Cost Analysis\n\n- Current spend breakdown with optimization recommendations\n- Priority action list (high\u002Fmedium\u002Flow) and implementation checklist\n\n---\n\n## Reference Documentation\n\n| Document | Contents |\n|----------|----------|\n| `references\u002Farchitecture_patterns.md` | 6 patterns: serverless, microservices, three-tier, data processing, GraphQL, multi-region |\n| `references\u002Fservice_selection.md` | Decision matrices for compute, database, storage, messaging |\n| `references\u002Fbest_practices.md` | Serverless design, cost optimization, security hardening, scalability |\n","","imported","https:\u002F\u002Fgithub.com\u002Falirezarezvani\u002Fclaude-skills","user_system_seed","SkillOPIC",true,204,786,"2026-05-16 13:55:58",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"41be96d3-ad74-46cc-ac40-38c8c5bc6397","1.0.0","aws-solution-architect.zip",37270,"uploads\u002Fskills\u002Fc78da4af-20a2-4533-9ed3-6f46eea72701\u002Faws-solution-architect.zip","9d65b4930233eaab0234cdeca700fd3d5f8e8468d4f6172a07315516ca192fca","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":10079},{\"path\":\"assets\u002Fexpected_output.json\",\"isDirectory\":false,\"size\":1567},{\"path\":\"assets\u002Fsample_input.json\",\"isDirectory\":false,\"size\":426},{\"path\":\"references\u002Farchitecture_patterns.md\",\"isDirectory\":false,\"size\":17544},{\"path\":\"references\u002Fbest_practices.md\",\"isDirectory\":false,\"size\":14587},{\"path\":\"references\u002Fservice_selection.md\",\"isDirectory\":false,\"size\":11265},{\"path\":\"scripts\u002Farchitecture_designer.py\",\"isDirectory\":false,\"size\":35618},{\"path\":\"scripts\u002Fcost_optimizer.py\",\"isDirectory\":false,\"size\":15618},{\"path\":\"scripts\u002Fserverless_stack.py\",\"isDirectory\":false,\"size\":17798}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]