Skip to content

Latest commit

 

History

History
454 lines (278 loc) · 15.8 KB

API.md

File metadata and controls

454 lines (278 loc) · 15.8 KB

API Reference

Constructs

ValheimWorld

Initializers

import { ValheimWorld } from 'cdk-valheim'

new ValheimWorld(scope: Construct, id: string, props?: ValheimWorldProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props ValheimWorldProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsOptional

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Properties

Name Type Description
backupPlan aws-cdk-lib.aws_backup.BackupPlan No description.
fileSystem aws-cdk-lib.aws_efs.FileSystem No description.
service aws-cdk-lib.aws_ecs.FargateService No description.
schedules ValheimWorldScalingSchedule[] No description.

backupPlanRequired
public readonly backupPlan: BackupPlan;
  • Type: aws-cdk-lib.aws_backup.BackupPlan

fileSystemRequired
public readonly fileSystem: FileSystem;
  • Type: aws-cdk-lib.aws_efs.FileSystem

serviceRequired
public readonly service: FargateService;
  • Type: aws-cdk-lib.aws_ecs.FargateService

schedulesOptional
public readonly schedules: ValheimWorldScalingSchedule[];

Structs

ValheimWorldProps

Initializer

import { ValheimWorldProps } from 'cdk-valheim'

const valheimWorldProps: ValheimWorldProps = { ... }

Properties

Name Type Description
backupPlan aws-cdk-lib.aws_backup.BackupPlan AWS Backup plan for EFS.
containerPath string The path on the container to mount the host volume at.
cpu number The number of cpu units used by the task.
desiredCount number Desired count of Fargate container.
environment {[ key: string ]: string} The environment variables to pass to the container.
fileSystem aws-cdk-lib.aws_efs.FileSystem Persistent storage for save data.
image aws-cdk-lib.aws_ecs.ContainerImage The image used to start a container.
logGroup aws-cdk-lib.aws_ecs.LogDriver Valheim Server log Group.
memoryLimitMiB number The amount (in MiB) of memory used by the task.
schedules ValheimWorldScalingScheduleProps[] Running schedules.
vpc aws-cdk-lib.aws_ec2.IVpc The VPC where your ECS instances will be running or your ENIs will be deployed.

backupPlanOptional
public readonly backupPlan: BackupPlan;
  • Type: aws-cdk-lib.aws_backup.BackupPlan
  • Default: Hourly backup with 3 days retension.

AWS Backup plan for EFS.


containerPathOptional
public readonly containerPath: string;
  • Type: string
  • Default: /config/

The path on the container to mount the host volume at.


cpuOptional
public readonly cpu: number;
  • Type: number
  • Default: 1024

The number of cpu units used by the task.

For tasks using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the memory parameter:

256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB)

512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB)

1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB)

2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB)

4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB)


desiredCountOptional
public readonly desiredCount: number;
  • Type: number
  • Default: 1

Desired count of Fargate container.

Set 0 for maintenance.


environmentOptional
public readonly environment: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: No environment variables.

The environment variables to pass to the container.


fileSystemOptional
public readonly fileSystem: FileSystem;
  • Type: aws-cdk-lib.aws_efs.FileSystem
  • Default: Amazon EFS for default persistent storage.

Persistent storage for save data.


imageOptional
public readonly image: ContainerImage;

The image used to start a container.

This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest.


logGroupOptional
public readonly logGroup: LogDriver;
  • Type: aws-cdk-lib.aws_ecs.LogDriver
  • Default: Create the new AWS Cloudwatch Log Group for Valheim Server.

Valheim Server log Group.


memoryLimitMiBOptional
public readonly memoryLimitMiB: number;
  • Type: number
  • Default: 2048

The amount (in MiB) of memory used by the task.

For tasks using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter:

512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)

1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)

2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)

Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)

Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)


schedulesOptional
public readonly schedules: ValheimWorldScalingScheduleProps[];

Running schedules.


vpcOptional
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc
  • Default: creates a new VPC with two AZs

The VPC where your ECS instances will be running or your ENIs will be deployed.


ValheimWorldScalingScheduleProps

Options for ValheimWorldScalingSchedule.

Initializer

import { ValheimWorldScalingScheduleProps } from 'cdk-valheim'

const valheimWorldScalingScheduleProps: ValheimWorldScalingScheduleProps = { ... }

Properties

Name Type Description
start aws-cdk-lib.aws_applicationautoscaling.CronOptions Options to configure a cron expression for server for server launching schedule.
stop aws-cdk-lib.aws_applicationautoscaling.CronOptions Options to configure a cron expression for server zero-scale schedule.

startRequired
public readonly start: CronOptions;
  • Type: aws-cdk-lib.aws_applicationautoscaling.CronOptions

Options to configure a cron expression for server for server launching schedule.

All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate. Only comma separated numbers and hypens are allowed.


stopRequired
public readonly stop: CronOptions;
  • Type: aws-cdk-lib.aws_applicationautoscaling.CronOptions

Options to configure a cron expression for server zero-scale schedule.

All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate. Only comma separated numbers and hypens are allowed.


Classes

ValheimWorldScalingSchedule

Represents the schedule to determine when the server starts or terminates.

Initializers

import { ValheimWorldScalingSchedule } from 'cdk-valheim'

new ValheimWorldScalingSchedule(schedule: ValheimWorldScalingScheduleProps)
Name Type Description
schedule ValheimWorldScalingScheduleProps No description.

scheduleRequired

Methods

Name Description
toCronOptions Returns the cron options merged properties for both start and stop.

toCronOptions
public toCronOptions(): CronOptions

Returns the cron options merged properties for both start and stop.

Properties

Name Type Description
start aws-cdk-lib.aws_applicationautoscaling.CronOptions Options to configure a cron expression for server for server launching schedule.
stop aws-cdk-lib.aws_applicationautoscaling.CronOptions Options to configure a cron expression for server zero-scale schedule.

startRequired
public readonly start: CronOptions;
  • Type: aws-cdk-lib.aws_applicationautoscaling.CronOptions

Options to configure a cron expression for server for server launching schedule.

All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate. Only comma separated numbers and hypens are allowed.


stopRequired
public readonly stop: CronOptions;
  • Type: aws-cdk-lib.aws_applicationautoscaling.CronOptions

Options to configure a cron expression for server zero-scale schedule.

All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate. Only comma separated numbers and hypens are allowed.