This is a CDK deployment project for spinning up the following systems on AWS:
- A TeamSpeak server running under
ts.
subdomain - An Arma 3 dedicated server running under
arma.
subdomain- A S3 bucket for storing the modpack
- A S3 bucket for storing the server configuration
- A S3 bucket for storing all Arma multiplayer missions
- The
arma-server/
directory defines the Arma 3 server Docker image - The
lib\pathfinder-infra-stack.ts
file defines the infrastructure stack. - The
cdk.json
defines execution parameters.
- Parametrize the stack definition further: Server memory and CPU sizes
- Add a simple method of starting/stopping the servers manually
- Add a simple method to sync mods from local workshop to S3
- An AWS account
- a Route53 domain
- Locally installed software:
- Docker Desktop
- Node.js
- NPM
- AWS CLI
- Configure AWS CLI credentials
- Bootstrap AWS environment
- Deploy the stack
- Parameters:
hostedZoneId
: The ID of the hosted zone that should be usedhostedZoneName
: The name of the hosted zonestartCron
: A cron expression describing when to start the server infrastructure (using UTC timezone)- default:
0 18 * * ? *
- default:
stopCron
: A cron expression describing when to stop the server infrastructure (using UTC timezone)- default:
0 23 * * ? *
- Note: It's better to have stop times for days where the server isn't started automatically, too, so a manually started server isn't forgotten and won't run for days.
- default:
steamUser
: Username of the steam user used to download and host the Arma serversteamPassword
: Password of the steam userarmaServerDiskSizeGiB
: Disk size of the Arma server in GiB- default: 70
- Outputs:
DataBucketNameOutput
- S3 bucket name to upload configuration for the Arma serverMissionsBucketNameOutput
- S3 bucket name to upload missions for the Arma serverModsBucketNameOutput
- an S3 bucket name to upload mods for the Arma server
- Parameters:
- From the Teamspeak server logs (see Monitoring Logs), extract the server admin token
token=...
- Connect to the Teamspeak server and enter the server admin token
- Follow the steps in Configuring the Arma server below
- Follow the steps in Adding mods to the Arma server below
- Follow the steps in Adding missions to the Arma server below
- On the AWS web console, navigate to CloudWatch
- Navigate to Log Groups
- Open a log group for the component of interest
- Open the latest log stream
- Create a valid server config file and save it as
main.cfg
- On the AWS web console, navigate to S3 and find the bucket from the
DataBucketNameOutput
- The following files are supported and can be uploaded to the bucket:
main.cfg
(documentation)cba_settings.sqf
(only if CBA is installed on the server | documentation)main.Arma3Profile
(documentation)
- Reboot the server (see Reboot the Arma server)
- Observe logs for any problems (see Monitoring Logs)
Note: This is a makeshift solution and will be replaced with a better one in the future.
- On the AWS web console, navigate to S3 and find the bucket name that was returned by
ModsBucketNameOutput
- Upload local mod directories directly
- Follow the steps in Reboot the Arma server below
- Observe logs for any problems (see Monitoring Logs)
Note: This is a makeshift solution and will be replaced with a better one in the future.
- In Arma, export the chosen mission as multiplayer mission (with
.pbo
file extension) - On the AWS web console, navigate to S3 and find the bucket from the
MissionsBucketNameOutput
- Upload the mission file
- Follow the steps in Reboot the Arma server below
- Observe logs for any problems (see Monitoring Logs)
Note: This is a makeshift solution and will be replaced with a better one in the future.
- On the AWS web console, navigate to ECS and find the ECS cluster
- In the ECS cluster, open the tasks and identify the Arma server task using the task definition prefixed with
PathfinderInfraStackArmaTask
- Stop the task
- Wait for the service to recreate the task
npm run build
compile typescript to jscdk deploy --parameters <params>
deploy this stack to your default AWS account/regioncdk destroy
destroy this stack (use with caution)cdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation templateaws logs tail $group_name --follow
to watch logs of a log group in AWSnpm install -g aws-cdk
to update CDK