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(terraform): support multiple EFS volumes per game server (#37)
## Summary
Refactored the EFS volume configuration to support multiple mount points
per game server, replacing the single `efs_path` field with a flexible
`volumes` list. Each volume entry now creates its own EFS access point
with isolated directory structure.
## Key Changes
- **Variable schema update**: Replaced `efs_path: string` with `volumes:
list(object({ name, container_path }))` in `game_servers` variable
definition
- **New local value**: Added `game_volumes` local that flattens
game-volume pairs into a keyed map (`${game}-${volume.name}`) for EFS
access point creation
- **EFS access point refactor**: Changed from one access point per game
to one per game-volume pair, with root paths now structured as
`/${game}/${volume_name}` instead of `/${game}`
- **Task definition volumes**: Converted static `volume` block to
`dynamic "volume"` block that iterates over `each.value.volumes`,
creating one volume mount per configured volume
- **Container mount points**: Updated `mountPoints` from a single static
entry to a dynamic list comprehension that maps each volume to its
container path
- **Documentation updates**: Updated setup guide, example configs, and
component docs to reflect the new `volumes` structure and explain the
per-volume access point isolation
## Implementation Details
- The flattening logic in `game_volumes` ensures each game-volume
combination gets a unique key while preserving all necessary metadata
(game name, volume name, container path)
- EFS access points maintain UID/GID 1000 ownership per volume, with
each volume isolated under its own directory hierarchy
- The change is backward compatible in behavior—single-volume games
simply have one entry in the `volumes` list
- All example configurations updated to demonstrate the new structure
(Palworld, Satisfactory, FoundryVTT)
https://claude.ai/code/session_01SkWgmzBi8EPkSvpf3shwno
---------
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
@@ -31,7 +31,7 @@ step 3 of the [setup guide](/setup) for details.
31
31
|`aws_region`|`string`|`us-east-1`| AWS region for all resources. |
32
32
|`project_name`|`string`|`game-servers`| Prefix for named resources and the Secrets Manager paths. |
33
33
|`vpc_cidr`|`string`|`10.0.0.0/16`| Parent CIDR; subnets are /24s within it. |
34
-
|`game_servers`|`map(object)`| — | The single source of truth. Per-game: `image`, `cpu`, `memory`, `ports[]`, `environment[]`, `efs_path`, `https`. |
34
+
|`game_servers`|`map(object)`| — | The single source of truth. Per-game: `image`, `cpu`, `memory`, `ports[]`, `environment[]`, `volumes[]` (`name` + `container_path`), `https`. Each `volumes` entry creates its own EFS access point rooted at `/${game}/${name}`. |
35
35
|`hosted_zone_name`|`string`|`codercoco.com`| Existing Route 53 zone looked up as a data source. |
36
36
|`acm_certificate_domain`|`string`|`null` → `*.{hosted_zone_name}`| Wildcard ACM cert for the ALB listener. |
37
37
|`dns_ttl`|`number`|`30`| TTL on Route 53 A records the update-dns Lambda writes. Keep low for fast task churn. |
0 commit comments