docs(aws): add terraform.tfvars.example and improve setup instructions

- Add terraform.tfvars.example with all required variables
- Update README.md to reference terraform.tfvars.example
- Add AWS account ID retrieval command
- Clarify required variables

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Shunsuke Hayashi 2026-01-26 13:36:21 +09:00
parent 5456077858
commit 5c34712412
2 changed files with 43 additions and 3 deletions

View File

@ -25,16 +25,22 @@ aws secretsmanager get-secret-value --secret-id clawdbot/discord-token
### 2. Terraform変数の設定
`.env.example`をコピーして`terraform.tfvars`を作成:
`terraform.tfvars.example`をコピーして`terraform.tfvars`を作成:
```bash
cp .env.example terraform.tfvars
cp terraform.tfvars.example terraform.tfvars
```
`terraform.tfvars`を編集して以下の値を設定:
- `aws_account_id`: AWSアカウントID
- `aws_account_id`: AWSアカウントID13桁の数字
- `discord_token_secret_name`: Secrets Managerのシークレット名デフォルト: `clawdbot/discord-token`
**重要**: `aws_account_id`は必須です。AWSコンソールまたは以下のコマンドで確認できます:
```bash
aws sts get-caller-identity --query Account --output text
```
### 3. Terraformの実行
```bash

View File

@ -0,0 +1,34 @@
# AWS Terraform Variables for Clawdbot ECS Fargate Deployment
# Copy this file to terraform.tfvars and fill in the values
# AWS Configuration
aws_region = "ap-northeast-1"
aws_account_id = "123456789012" # Your AWS account ID
# Environment
environment = "production"
project_name = "clawdbot"
# ECS Configuration
ecs_task_cpu = 256 # 0.25 vCPU
ecs_task_memory = 2048 # 2 GB
ecs_service_desired_count = 1
# Discord Token (DEPRECATED - Use Secrets Manager instead)
# discord_token = "your_bot_token_here" # DO NOT use in production
# Secrets Manager Secret Name for Discord Bot Token
discord_token_secret_name = "clawdbot/discord-token"
# Create the secret in AWS Secrets Manager before running Terraform:
# aws secretsmanager create-secret \
# --name clawdbot/discord-token \
# --description "Discord Bot Token for Clawdbot" \
# --secret-string "your_bot_token_here"
# DynamoDB Tables
sessions_table_name = "clawdbot-sessions"
artifacts_table_name = "clawdbot-artifacts"
# S3 Bucket
artifacts_bucket_name = "clawdbot-artifacts"
artifacts_bucket_ttl_days = 7