Commit Graph

4 Commits

Author SHA1 Message Date
Shunsuke Hayashi
afb659487c chore(ppal-aws): add terraform.tfstate after apply
Terraform apply complete - 25 resources created:
- API Gateway HTTP API (Discord Interactions)
- Lambda Function (ECR image)
- DynamoDB Tables (users, conversations)
- Secrets Manager (4 secrets)
- IAM Role + inline policies
- CloudWatch Log Groups

Endpoints:
- API Gateway: https://yov87xk6nb.execute-api.ap-northeast-1.amazonaws.com
- Discord Interactions: https://yov87xk6nb.execute-api.ap-northeast-1.amazonaws.com/interactions
- Lambda Function URL: https://b6hld4ksms3np2le3anzdnxsc40cnqfg.lambda-url.ap-northeast-1.on.aws/

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 21:58:49 +09:00
Shunsuke Hayashi
e31a0af9cc fix(ppal-aws): add discord-api-types and fix Dockerfile
Add missing discord-api-types dependency and fix Docker build:
- Add discord-api-types to dependencies
- Fix Dockerfile (npm ci without --omit=dev for build stage)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 21:53:00 +09:00
Shunsuke Hayashi
ca0e991272 feat(ppal-aws): add Lambda handler for Discord Bot
Add Node.js 22 Lambda function for PPAL Discord Bot:
- Discord Interactions API with Ed25519 signature verification
- Slash commands: /ppal status/help, /miyabi issue/status, /help
- DynamoDB integration for user state management
- Secrets Manager integration for token retrieval
- GitHub API integration for issue creation

Files:
- package.json: Dependencies (aws-sdk v3, discord-api-types, tweetnacl)
- tsconfig.json: TypeScript strict mode, ES2022 target
- Dockerfile: Multi-stage Node.js 22 Alpine build
- src/index.ts: Lambda handler with signature verification
- src/discord/verify.ts: Ed25519 signature validation
- src/discord/commands.ts: Command handlers for /ppal, /miyabi, /help
- src/services/secrets.ts: AWS Secrets Manager client
- src/services/dynamodb.ts: DynamoDB DocumentClient operations

Commands:
- /ppal status: System status with user info
- /ppal help: PPAL commands help
- /miyabi issue <title>: Create GitHub issue
- /miyabi status: Miyabi agent society status
- /help: Full command list

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 19:09:12 +09:00
Shunsuke Hayashi
abed5cb5cb feat(ppal-aws): add Terraform configuration for Discord Bot
Add AWS infrastructure as code for PPAL Discord Bot:
- API Gateway (HTTP API) for Discord Interactions endpoint
- Lambda function (Node.js 20.x container image)
- DynamoDB tables (users, conversations) with PAY_PER_REQUEST
- Secrets Manager for tokens (Discord, GitHub, OpenAI)
- IAM role with inline policies for Lambda execution

Files:
- versions.tf: Terraform 1.0+ with AWS provider 5.x
- variables.tf: environment, project_name, lambda config
- api_gateway.tf: HTTP API with CloudWatch logging
- lambda.tf: ECR-based Lambda with function URL
- dynamodb.tf: GSI-enabled tables with PITR & encryption
- secrets.tf: 4 secrets with placeholder values
- iam.tf: Inline policies for DynamoDB, Secrets, Logs, ECR
- outputs.tf: Endpoint URLs, ARNs (sensitive)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 19:04:55 +09:00