Coder Social home page Coder Social logo

cdk-valheim's Introduction

GitHub Workflow Status GitHub license npm PyPI - Downloads

cdk-valheim

A high level CDK construct of Valheim dedicated server.

Features

  • Fargate cluster to run a Valheim server, with EFS for persistence (schedulable)
  • Hourly AWS Backup with 3 days retention (customizable)
  • lloesche/valheim-server as the default container image (replaceable)

See integration test for an example.

API Doc

See API.md

References

Examples

The construct is published to both npm and PyPI.

TypeScript

new ValheimWorld(stack, 'ValheimWorld', {
  cpu: 2048,
  memoryLimitMiB: 4096,
  schedules: [{
    start: { hour: '12', weekDay: '1-5' },
    stop: { hour: '1', weekDay: '1-5' },
  }],
  environment: {
    SERVER_NAME: 'CDK Valheim',
    WORLD_NAME: 'Amazon',
    SERVER_PASS: 'fargate',
    BACKUPS: 'false',
  },
});

Python

ValheimWorld(
    self, 
    'ValheimWorld',   
    cpu=2048,
    memory_limit_mib=4096,
    schedules=[ValheimWorldScalingSchedule(
        start=CronOptions(hour='12', week_day='1-5'),
        stop=CronOptions(hour='1', week_day='1-5'),
    )],
    environment={
        'SERVER_NAME': 'CDK Valheim',
        'WORLD_NAME': 'Amazon',
        'SERVER_PASS': 'fargate',
        'BACKUPS': 'false',
    })

Testing

  • Unit test and snapshot test
npx projen test
  • Integration test
npx cdk -a "npx ts-node src/integ.valheim.ts" diff
npx cdk -a "npx ts-node src/integ.valheim.ts" deploy

cdk-valheim's People

Contributors

dependabot[bot] avatar gotodeploy avatar neilkuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cdk-valheim's Issues

Container image should be replaceable

Why

The mount point of container is fixed and immutable. This makes container image not fully replaceable.

TODO

  • Add containerPath prop to ValheimWorldProps

Use DataSync for moving world data between S3 and EFS

Thanks for providing this great construct! I have used it recently to setup a dedicated server and it is working well. Would it make sense to add DataSync tasks to sync data between EFS and an S3 bucket where world data can be uploaded? How would you recommend moving world data stored on local machine to EFS?

A comment says opening TCP but it's actually UDP

Valheim needs UDP ports from 2456 to 2458 to be opened. Below should be fixed.

    // Allow TCP 2456-2458 for Valheim
    this.service.connections.allowFrom(ec2.Peer.anyIpv4(), ec2.Port.udpRange(2456, 2458));

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

Add a detailed feature description, badges and an python example to the README.md

Features

  • Fargate cluster + EFS + AWS backup
  • Scheduling start/stop (+ backup)
  • Fully replaceable container image

Badges

https://shields.io/

GitHub license
npm
PyPI - Downloads
GitHub Workflow Status

Python example

cdk_valheim.ValheimWorld(
    self, 
    'ValheimWorld',   
    cpu=2048,
    memory_limit_mib=4096,
    schedules=[cdk_valheim.ValheimWorldScalingSchedule(
        start=CronOptions(hour='12', week_day='1-5'),
        stop=CronOptions(hour='1', week_day='1-5'),
    )],
    environment={
        "SERVER_NAME": 'CDK Valheim',
        "WORLD_NAME": 'Amazon',
        "SERVER_PASS": 'fargate',
        "BACKUPS": 'false',
    })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.