Setup guide
This is the end-to-end walkthrough, from a blank AWS account to a running Fargate task you can connect to from your game client, plus the optional Discord bot. Allow ~15–20 minutes the first time; most of that is waiting for the infrastructure apply.
Every step after creating the IAM user happens inside the app — there is no separate CLI tool to install, configure, or run. The in-app setup wizard bootstraps AWS resources and initializes the Pulumi stack; the Infrastructure page then plans and applies the actual game-server infrastructure.
Prerequisites
| Tool | Version | Notes |
|---|---|---|
| Node.js | 24+ | Matches engines.node in the root package.json, docs/package.json, and scripts/package.json, and the version every CI workflow runs. Not enforced at boot — the backend does not check the Node version — but nothing is tested below 24. |
| npm | 10+ | Ships with Node 24. |
There is no separate infrastructure or AWS CLI prerequisite. The desktop app talks to AWS directly via the SDK, and Pulumi's engine is provisioned automatically by the app itself (see step 2) — there is nothing to install manually.
On the AWS side you need:
- An AWS account you control (pure personal use is fine).
- A Route 53 hosted zone you already own — e.g.
yourdomain.com. The infra program looks it up as a data source and will not create it for you. If you use an external registrar, delegate the zone's NS records to Route 53 before your first apply or DNS updates will go nowhere.
1. Create and authorise an IAM user
You don't need to touch the IAM console. Launch the app and follow the wizard — step 2 of 5 does this for you: it renders a CloudFormation template, opens the AWS console pre-scoped to the region you chose, and you upload the template and create the stack. Paste the resulting bootstrap access key back into the wizard and the app immediately mints its own key from that same principal, verifies it works, and revokes the bootstrap key — a mint-then-revoke rotation, so the credential the app ends up holding is never the one that was briefly visible in the CloudFormation stack's Outputs.
Manual fallback
Prefer not to use guided setup, already have credentials, or hit an edge case guided setup doesn't cover? Choose I already have credentials on the wizard's guided-IAM step to skip straight to the credentials step, and set up the IAM user by hand instead:
- In the AWS IAM console →
Users → Create user, give it a name like
hyveon. - On the permissions step, choose Attach policies directly and skip through without selecting any managed policy. Create the user.
- Open the new user → Permissions → Add permissions → Create inline
policy → JSON. Paste the policy below, name it
HyveonDeployAll, and save. - Security credentials → Create access key → Command Line Interface (CLI). Copy the Access Key ID and Secret Access Key. Treat the secret like a password — AWS will not show it again. You'll paste these into the in-app setup wizard's credentials step (or point the wizard at an existing AWS CLI profile instead, if you already have one).
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "HyveonDeploy",
"Effect": "Allow",
"Action": [
"ecs:*",
"elasticfilesystem:*",
"ec2:*",
"lambda:*",
"logs:*",
"cloudwatch:*",
"events:*",
"scheduler:*",
"route53:*",
"dynamodb:*",
"secretsmanager:*",
"s3:*",
"cloudfront:*",
"acm:*"
],
"Resource": "*"
},
{
"Sid": "HyveonIAM",
"Effect": "Allow",
"Action": "iam:*",
"Resource": [
"arn:aws:iam::*:role/hyveon-*",
"arn:aws:iam::*:policy/hyveon-*"
]
},
{
"Sid": "HyveonIAMSimulate",
"Effect": "Allow",
"Action": "iam:SimulatePrincipalPolicy",
"Resource": "arn:aws:iam::*:user/${aws:username}"
},
{
"Sid": "HyveonConfigurationBucket",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject",
"s3:ListBucket",
"s3:GetObjectVersion",
"s3:GetBucketVersioning",
"s3:PutBucketVersioning",
"s3:GetBucketLocation",
"s3:PutLifecycleConfiguration",
"s3:PutEncryptionConfiguration",
"s3:PutBucketPublicAccessBlock"
],
"Resource": [
"arn:aws:s3:::${project_name}-config",
"arn:aws:s3:::${project_name}-config/*"
]
},
{
"Sid": "HyveonStateBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject",
"s3:PutBucketVersioning",
"s3:PutEncryptionConfiguration",
"s3:PutBucketPublicAccessBlock"
],
"Resource": [
"arn:aws:s3:::${project_name}-tfstate",
"arn:aws:s3:::${project_name}-tfstate/*"
]
},
{
"Sid": "HyveonServiceLinkedRoles",
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS*",
"Condition": {
"StringEquals": { "iam:AWSServiceName": "ecs.amazonaws.com" }
}
},
{
"Sid": "HyveonServiceLinkedRoleRead",
"Effect": "Allow",
"Action": "iam:GetRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS*"
}
]
}
Why one inline policy instead of stacking managed policies? AWS caps each user at 10 directly-attached managed policies, and this stack touches ~14 services. One inline policy also keeps the full blast radius visible in one place. Trade-off: you lose AWS's auto-maintenance of action lists, but since everything is
{service}:*there is nothing to maintain.
iam:*is scoped to project-prefixed ARNs, notResource: *, to avoid grantingiam:PassRoleon every role in the account. Thehyveon-*prefix matches the default project name. If you change the project name in the wizard, update the two ARN patterns inHyveonIAMto match.
HyveonIAMSimulategrants the setup wizard's own permission check. The wizard'siam:SimulatePrincipalPolicyself-check (IamCheckService) always targets the calling principal's own ARN, so the${aws:username}policy variable scopes this to exactly that principal rather than every IAM user in the account. Without it, the check getsAccessDeniedand silently degrades to a warning.
HyveonConfigurationBucketscopes access to the JSON configuration bucket the setup wizard's bootstrap step creates (default name${project_name}-config; it holds the versioneddeployment-config.jsonobject). It grants object read/write/list/versioning access plus the bucket-config actions (PutLifecycleConfiguration,PutEncryptionConfiguration,PutBucketPublicAccessBlock,PutBucketVersioning/GetBucketVersioning,GetBucketLocation) the bootstrap step needs to configure the bucket's lifecycle rule (expiring noncurrent versions after 90 days), public-access block, and versioning. Althoughs3:*inHyveonDeployalready covers these actions on every bucket, this statement documents the specific dependency and scopes it to just the two configuration-bucket ARNs. If you rename this bucket, update the two ARN patterns inHyveonConfigurationBucketto match.
HyveonStateBucketscopes the specific permissions Pulumi's self-managed S3 state backend needs on${project_name}-tfstate— the bucket the setup wizard's bootstrap step creates to hold Pulumi state.s3:ListBucket(bucket-level) pluss3:GetObject/s3:PutObject/s3:DeleteObject(object-level) are exactly what Pulumi's DIY S3 backend needs to read and write state objects and its own lock objects — there is no DynamoDB lock table, since Pulumi's self-managed S3 backend stores its lock as an object in the same bucket rather than a companion table.s3:PutBucketVersioningands3:PutEncryptionConfigurationare what the bootstrap step'sensureStateBucketcall uses to enable versioning and default (AES256) encryption on this bucket;s3:PutBucketPublicAccessBlocklets it harden the bucket against public access, the same as it already does for the configuration bucket. As withHyveonConfigurationBucket,s3:*inHyveonDeployalready covers all of this on every bucket — this statement documents the specific dependency and scopes it to just the two state-bucket ARNs. If you rename this bucket, update the two ARN patterns inHyveonStateBucketto match.
Two permission areas are not covered by any AWS managed policy and are
explicitly included above to avoid AccessDenied during an apply:
- EventBridge tag operations — the AWS provider tags EventBridge rules on creation, which requires
events:TagResource,events:UntagResource, andevents:ListTagsForResource.events:*above already grants these — if you tighten the policy later, keep those three actions in. - EventBridge Scheduler — the FileBrowser helper's auto-stop schedule is a one-time
scheduler.amazonaws.comschedule, a distinct service (and IAM action prefix) from theevents:*EventBridge rules above.scheduler:*grantsscheduler:CreateSchedule/scheduler:DeleteSchedule;iam:*(scoped tohyveon-*roles inHyveonIAM) covers theiam:PassRolethe app needs to hand the schedule its execution role. - CloudFront — the Discord interactions endpoint is fronted by a CloudFront distribution.
cloudfront:*above covers creation, updates, tagging, and deletion of distributions. - ACM (Certificate Manager) — CloudFront's custom domain (
discord.{hosted_zone_name}) needs a DNS-validated ACM certificate, always provisioned inus-east-1regardless of your chosen region. This needsacm:RequestCertificate,acm:DescribeCertificate,acm:AddTagsToCertificate, andacm:DeleteCertificateat minimum;acm:*above covers all of it. ACM certificate ARNs aren't predictable before creation (unlike the project-prefixed IAM roles/policies inHyveonIAM), so this is scoped likecloudfront:*/route53:*above —Resource: "*"within theHyveonDeploystatement, not a separate ARN-scoped statement.
HYVEON_DEPLOY_ALL_ACTIONS in app/packages/shared/src/iamPolicy.ts is the
single source of truth for IAM permissions — this JSON block is generated
from it, not the other way around. If you need to add or remove permissions,
update HYVEON_DEPLOY_ALL_ACTIONS there, not this documentation; do not
create separate inline policies or update the README independently. Two
things in the app are generated from that same shared source: the in-app
setup wizard's IAM permission check (see step 2)
simulates every action in it against your credentials, and the guided-IAM
step's CloudFormation template generates its HyveonDeployAll managed policy
from it too — so the permissions the guided flow provisions can never drift
from what the wizard check simulates. This JSON block itself is test-locked
against HYVEON_DEPLOY_ALL_ACTIONS
(app/packages/shared/src/iamPolicy.test.ts), so it must be updated to match
whenever the shared source changes, or that test fails.
HyveonSelfRotate: a second, narrower managed policy
The guided-IAM CloudFormation template also attaches a second managed
policy, HyveonSelfRotate, to the deploy user it creates. It grants exactly
three actions — iam:CreateAccessKey, iam:DeleteAccessKey,
iam:ListAccessKeys — scoped via a CloudFormation Fn::Sub to the created
user's own ARN (arn:aws:iam::*:user/${UserName}), never to Resource: "*"
or every user in the account.
This exists so the deploy principal can rotate its own access key — which
both the guided flow's mint-then-revoke sequence and the app's own
AwsProfileService.rotateActiveCredentials() need — without granting
standing iam:* on all IAM users, which HyveonDeployAll's HyveonIAM
statement deliberately does not do (it's scoped to hyveon-* roles and
policies, not users). If you hand-roll your own IAM user via the
manual fallback instead of guided setup, add these same
three actions — scoped to that user's own ARN — or self-rotation from the
app will fail with AccessDenied.
2. Clone, install, and launch the wizard
git clone https://github.com/CoderCoco/Hyveon.git
cd Hyveon
npm install
npm run desktop:run
desktop:run chains three steps: app:build compiles every TypeScript
workspace (@hyveon/shared → @hyveon/infra → @hyveon/cloud-aws →
@hyveon/desktop-main → @hyveon/desktop-preload → @hyveon/web), then
desktop:build runs electron-vite build, then app:start launches the
built app. On a clean checkout npm run desktop:build alone fails — Vite
can't resolve @hyveon/shared and the other workspace packages until
app:build has compiled them — so desktop:run exists to get from a fresh
clone to a running app in one command without hitting that error first.
Once you've run app:build at least once, you don't need to repeat it on
every iteration:
npm run desktop:build
npm run app:start
Use this manual two-step when you're iterating on Electron main/preload or renderer code without touching the shared/infra/cloud-aws TypeScript — it skips recompiling every workspace and just re-bundles and relaunches.
npm run desktop:dev (hot-reload dev mode) has a known outstanding bundling
bug unrelated to this migration and shouldn't be used right now — use
desktop:run (or the manual two-step above) instead; re-run after pulling
new code.
The first launch replaces the entire window with the first-run setup wizard — there is no dashboard, no sidebar, and no way to skip it. Five steps, none of them a CLI command:
- Choose your cloud — AWS is the only option today.
- Provision AWS access — enter the region you want to deploy into, then
either Continue with guided setup (the default) or I already have
credentials to skip straight to step 3. Guided setup renders the
iam-bootstrap.yamlCloudFormation template to disk, opens the AWS console's Create Stack page pre-scoped to your region, and has you upload the template and paste back the Access Key ID / Secret Access Key from the stack's Outputs. The app validates that key, then automatically mints a replacement, verifies it, and revokes the bootstrap key — see step 1 for why. If the newly minted key fails verification (AWS key propagation can lag a few seconds) the step offers Retry rotation against the same bootstrap key; if revoking the bootstrap key itself fails, the new key is already active and the step gives you a direct IAM console link to revoke it by hand. Progress is checkpointed at every sub-stage, so quitting mid-flow resumes here rather than losing your place. - AWS credentials — if you completed guided setup in step 2, this step shows a satisfied summary ("Hyveon already provisioned and activated AWS credentials during guided setup") instead of asking you to pick a profile or paste keys — a Switch to a different source button is there if you change your mind. Otherwise, pick an existing AWS CLI profile, or paste the access key you created under Manual fallback directly; either way pasted keys are encrypted with your OS keychain, never stored in plaintext.
- Bootstrap AWS resources — creates the state bucket, the
configuration bucket, and the run-history table directly via the AWS SDK
(no CLI, and none of the three is Pulumi-managed): a
state bucket (default
hyveon-tfstate, versioned, AES-256 encrypted) that Pulumi's self-managed S3 backend reads and writes state to; a configuration bucket (defaulthyveon-config, versioned, 90-day noncurrent-version expiry, AES-256 encrypted) that holds the JSON configuration object your game servers are declared in; and a run-history table (defaulthyveon-runs) that records every plan/apply/destroy run. All three names can be selected during this bootstrap step; the run-history table name cannot change afterward without a migration, since it names an already-created physical table. This step also seeds the configuration object with an initial, empty document (gameServers: {}, every other field at its default) if one doesn't already exist — without this seed, nothing else in the app ever creates that first object, so Settings saves, Games-page adds, and Pulumi previews would otherwise fail immediately after the wizard finishes. Finally, this step has an advisory IAM permission check — it simulates theHyveonDeployAllpolicy's actions against your credentials and tells you exactly which are missing, but never blocks you from continuing. - Finish setup — resolves and installs the pinned Pulumi engine, installs the AWS provider plugin, and initializes the Pulumi stack against the bucket you just created. Runs automatically on arrival; no configuration needed beyond what you already entered.
Progress is saved on every step change, so you can close the app and pick up where you left off. Full detail, screenshot-by-screenshot, is in First-run wizard. Settings has a "Reconfigure" flow that re-runs this wizard later if you need to switch AWS profiles, regions, or bucket names.
Finishing the wizard only creates the backend — the buckets Pulumi stores state and configuration in. Your actual game-server infrastructure (the ECS cluster, EFS filesystem, Lambdas, DynamoDB tables, Route 53 wiring) does not exist yet; that's step 4.
3. Add your first game
Open the Games page and click Add game. A six-step wizard collects the container image, the Fargate CPU/memory pair, the ports it listens on, the EFS volumes it needs, and any environment variables to inject into the container:
Image: thijsvanloef/palworld-server-docker:latest
CPU / Memory: 2048 / 8192
Ports: 8211/udp, 27015/udp
Environment: PLAYERS=8, SERVER_NAME=My Palworld Server
EFS volume: name "saves", container path /palworld
Submitting the wizard writes one entry into the versioned JSON configuration
object (deployment-config.json, in the configuration bucket from
step 2) and nothing else — no
AWS resource exists yet. See Games for what every field does
once the config is applied, and how to edit or remove a game afterwards.
Rules worth knowing before you save:
- Volumes — each entry creates a dedicated EFS access point rooted at
/${game}/${name}and mounts it at the container path you give it. Most games need one entry. All access points use UID/GID 1000 ownership — game images that run as a different UID will fail to mount. file_seeds(optional; the Storage step's second list) pre-populates files on the EFS volume during apply. Each seed needs an in-container path and either UTF-8contentor base64content_base64(for binary files, e.g. mod.pakfiles). The seeder runs once per unique seed content and is a no-op on re-apply when nothing changes. Removed entries are not deleted from EFS. Do not put secrets infile_seeds— content is written into the JSON configuration object.https = true(optional; the Networking step's toggle) adds an in-task Caddy reverse-proxy sidecar that terminates TLS via Let's Encrypt automatic HTTPS, opening 443/tcp and 80/tcp publicly on the game's security group. Only set it on games that actually serve HTTP(S); UDP games (most game servers) must stayfalse. On a game's first-ever boot, expect the sidecar to take a couple of minutes after the server reaches RUNNING before HTTPS is live — it can't request a certificate until the update-dns Lambda's DNS record for the game propagates. Certificates persist on EFS, so this delay does not recur on subsequent restarts.- CPU / memory must be a valid Fargate pair (see the Fargate task size table).
- There is no way to declare a per-game DNS record from the app — the update-dns Lambda owns that entirely.
4. Plan and apply the infrastructure
Go to Infrastructure, click Run plan, read the change summary
(N to create / N to update / N to delete), click Approve plan,
then Apply. Full mechanics — the approval expiry, the plan-hash check,
run history, rollback — are in Infrastructure.
The first apply takes a few minutes end-to-end. It creates the VPC, two
public subnets, an ECS cluster, one task definition + EFS access point +
CloudWatch log group per game (HTTPS games get a second, Caddy sidecar
container plus a dedicated cert-storage EFS access point in the same task
definition — no separate load balancer or ACM certificate resource), the
four always-on Lambdas (interactions, followup, update-dns, watchdog) plus a
conditional per-game efs-seeder Lambda for any game with file_seeds,
three DynamoDB tables (Discord config/state, the audit log, and the
plan/apply run history), two Secrets Manager secrets, and the EventBridge
rule + schedule. The deploy IAM policy's existing dynamodb:* statement
(see step 1) already covers all
three tables — no policy change is needed.
When it finishes, the interactions Lambda's Function URL is available from the Discord page's Credentials tab — you'll need it in step 6.
5. Run the management app
Hyveon is a packaged Electron desktop app — there's no HTTP server or bearer token to configure. Pick one of the two ways to run it: