diff --git a/workers/clawdbot-aws/terraform/README.md b/workers/clawdbot-aws/terraform/README.md index 6e7bf1de5..f0c98d077 100644 --- a/workers/clawdbot-aws/terraform/README.md +++ b/workers/clawdbot-aws/terraform/README.md @@ -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アカウントID(13桁の数字) - `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 diff --git a/workers/clawdbot-aws/terraform/terraform.tfvars.example b/workers/clawdbot-aws/terraform/terraform.tfvars.example new file mode 100644 index 000000000..26d6e9e33 --- /dev/null +++ b/workers/clawdbot-aws/terraform/terraform.tfvars.example @@ -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