You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(discord): per-game connect_message in server-running responses (#44)
Adds an optional `connect_message` field to the `game_servers` Terraform
variable. Operators set a template string (e.g. `connect at
{host}:{port}`) that is rendered in Discord when a server reaches
RUNNING — both on the initial `/server-start` reply and in the
update-dns PATCH when the public IP/hostname resolves. Supports
`{host}`, `{ip}`, `{port}`, and `{game}` placeholders.
When absent the existing inline `` — `{host}` `` suffix is preserved as
the fallback, so no operator action is required for existing
deployments.
## Changes
- `terraform/variables.tf` — add `connect_message = optional(string)` to
`game_servers`
- `terraform/followup.tf` + `route53.tf` — wire `CONNECT_MESSAGES` and
`GAME_PORTS` env vars
- `app/packages/shared/src/formatStatus.ts` — extend
`formatGameStatus()` to accept optional connect message and port;
interpolate placeholders; render on a second line
- `app/packages/lambda/followup/src/handler.ts` — pass connect message
through `handleList`, `handleStatus`, and `handleStart` (start reply
gets a hostname preview)
- `app/packages/lambda/update-dns/src/handler.ts` — pass connect message
to `notifyDiscordIfPending` so the RUNNING-state PATCH includes the hint
- Tests, `terraform.tfvars.example`, and docs updated per CLAUDE.md
checklist
## Test plan
- [ ] All 238 existing tests pass (`cd app && npm test`)
- [ ] 10 new `formatGameStatus` test cases cover placeholder
substitution, multi-line messages, missing placeholders, and fallback
behaviour
- [ ] Deploy with a game that has `connect_message = "connect in game at
{host}:{port}"` and verify the hint appears in the Discord start reply
and in the RUNNING update
Closes#40https://claude.ai/code/session_015YprouEhsqpJLPDC5ZrrSE
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/docs/components/terraform.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ step 3 of the [setup guide](/setup) for details.
32
32
|`aws_region`|`string`|`us-east-1`| AWS region for all resources. |
33
33
|`project_name`|`string`|`game-servers`| Prefix for named resources and the Secrets Manager paths. |
34
34
|`vpc_cidr`|`string`|`10.0.0.0/16`| Parent CIDR; subnets are /24s within it. |
35
-
|`game_servers`|`map(object)`| — | The single source of truth. Per-game: `image`, `cpu`, `memory`, `ports[]`, `environment[]`, `volumes[]` (`name` + `container_path`), `https`, `file_seeds[]` (optional). Each `volumes` entry creates its own EFS access point rooted at `/${game}/${name}`. See `game_servers[].file_seeds` below. |
35
+
|`game_servers`|`map(object)`| — | The single source of truth. Per-game: `image`, `cpu`, `memory`, `ports[]`, `environment[]`, `volumes[]` (`name` + `container_path`), `https`, `connect_message` (optional), `file_seeds[]` (optional). Each `volumes` entry creates its own EFS access point rooted at `/${game}/${name}`. `connect_message` controls the Discord connection hint shown when a server reaches RUNNING; supports `{host}`, `{ip}`, `{port}`, and `{game}` placeholders. See `game_servers[].file_seeds` below. |
36
36
|`hosted_zone_name`|`string`|_(required)_| Existing Route 53 zone looked up as a data source (e.g. `example.com`). |
37
37
|`acm_certificate_domain`|`string`|`null` → `*.{hosted_zone_name}`| Wildcard ACM cert for the ALB listener. |
38
38
|`dns_ttl`|`number`|`30`| TTL on Route 53 A records the update-dns Lambda writes. Keep low for fast task churn. |
0 commit comments