Giter Club home page Giter Club logo

valheim-ecs-fargate-cdk's Introduction

valheim-ecs-fargate-cdk

this could be you!

This is a CDK Project for spinning up a Valheim game server on AWS Using ECS Fargate and Amazon EFS!

Uses valheim-server-docker - thanks to lloesche for putting it together!

Table of Contents

Installation/Deployment

Making the assumption you have an AWS Account Already and a valid set of creds configured:

  1. Create a Secret named valheimServerPass in the same region you plan to deploy the CDK Stack - we reference it by name here and pass that value to our container as a secret. valheim-server-docker requires this to be AT LEAST 5 characters (ideally much more). The secret string should be a key value pair as below:
aws secretsmanager create-secret --name valheimServerPass --secret-string '{"VALHEIM_SERVER_PASS":"SuperSecretServerPassword"}'
  1. Clone down our source code:
git clone [email protected]:rileydakota/valheim-ecs-fargate-cdk.git && valheim-ecs-fargate-cdk
  1. Install dependencies:
npm i
  1. Setup the config
cp .env.example .env
  1. Decide if you want the optional AWS App gateway lambda endpoints to start and stop your server and get the server status. If you do, then change APPGW_START_STOP_PASSWORD in .env.

  2. Assuming you have already bootstrapped your account via the CDK (see here if not) - deploy the stack

npx cdk deploy --all
  1. enjoy accidentally chopping trees onto your friends powered by AWS!

Configuration

Valheim Server

If you want to configure the Valheim server, then you can do so in .env. Environment variables with the VALHEIM_DOCKER_ prefix will be used in the environment we run the docker image in.

To see a full list of possible environment variables, see valheim-server-docker#environment-variables

Bootstrapping with existing world

  1. This must be a fresh depoyment. If /config/worlds_local/ exists in the container, then we will not copy the files from S3 into the docker container.
  2. Create a ZIP file of your existing world.
  • This MUST follow the folder structure at the bottom of the steps.
  • The name of this ZIP file MUST match the BOOTSTRAP_WITH_WORLD_NAME environment variable (in .env).
  1. Update BOOTSTRAP_WITH_WORLD_NAME in .env to the same filename.
  2. Deploy npx cdk deploy --all
  3. After depoying, double check and make sure that the world was loaded and it didn't error and create a new one.
  • I would check for something likeLoad world: MyCoolValheimServer (MyCoolValheimServer)
  • If this was a world from a previous version, then you should see a lot of Old location found ... messages.

ZIP archive structure:

# kayo @ ClockTower in ~/workspace/valheim-ecs-fargate-cdk on git:bootstrap-world o [22:02:46] 
$ unzip -l resources/worlds/valheim_backup_2023-01-08T09_26_00_00.zip
Archive:  resources/worlds/valheim_backup_2023-01-08T09_26_00_00.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       39  2021-02-13 18:16   adminlist.txt
       40  2021-02-13 18:16   bannedlist.txt
       42  2021-02-13 18:16   permittedlist.txt
      217  2021-02-12 20:26   Player-prev.log
      217  2021-02-12 20:28   Player.log
      218  2023-01-02 23:39   prefs
        0  2023-01-08 20:52   worlds_local/
 69646068  2022-11-28 12:04   worlds_local/MyCoolValheimServer.db
       44  2022-11-28 12:04   worlds_local/MyCoolValheimServer.fwl
---------                     -------
141326454                     13 files

Solution Cost Information

Coming soon

Common Problems/FAQ

Accessing the docker container

This assumes that you either have credentials that give you admin roles or have setup an IAM role with the required permsissions.

aws ecs execute-command 
  --region <REGION> \
  --cluster <YOUR_CLUSTER_NAME_GOES_HERE_CHANGEME> \
  --task <YOUR_TASK_ID_GOES_HERE_CHANGEME>  \
  --command "/bin/bash" \
  --interactive

Now you should have an interactive shell you can use to explore the container.

How do I find the IP of my server?

Via the ecs-cli:

Install the ecs-cli by running the following (this assumes Linux - for other environments see here)

sudo curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-linux-amd64-latest
sudo chmod +x /usr/local/bin/ecs-cli

Using the Cluster Name outputted by successfully running the CDK template - run the following command:

ecs-cli ps --cluster YOUR_CLUSTER_NAME_GOES_HERE_CHANGEME

You will be presented with the public ip of your server as follows:

Name                                                                                                            State    Ports                                                                                     TaskDefinition                                            Health
ValheimServerAwsCdkStack-fargateCluster7F3D820B-AxbOSXn1ghAs/8d190269c9df4d3e9709dccb89bdf3d8/valheimContainer  RUNNING  1.1.1.1:2456->2456/udp, 1.1.1.1:2457->2457/udp, 1.1.1.1:2458->2458/udp  ValheimServerAwsCdkStackvalheimTaskDefinitionB5805DE1:17  UNKNOWN

Game server runs on port 2456 (unless changed)

Via the AWS Console:

goto the ECS Service page (click the services dropdown and select ECS - or click here if you are in us-east-2). From here - you will see a Cluster listed. Click the cluster name to continue to the details page. ECS Service Page

At the bottom half of the screen - click the Tasks tab tab - you should see a "Task ID". Click the task id to continue to the next page. Cluster Information Page

Finally - the public IP of your server will be listed here - under the Network section. Connect to the server using the IP and port 2456! Task Information Page


To-Do

Coming soon

valheim-ecs-fargate-cdk's People

Contributors

giantcow avatar martinbjeldbak avatar rileydakota avatar rjaduthie 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  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  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  avatar

valheim-ecs-fargate-cdk's Issues

Add capability to output server IP after deployment

For people who aren't experienced with ECS/AWS - it would be useful to have an easy way to output the Public IP address of the task created for Valheim. This can either be in the form of a custom resource that runs after the other resources are deployed, or a simple provided script in the docs that users can run.

Assistance: Modifying Environment after already starting up the server

Hello Team, big thanks to all the work you do! I really appreciate it.
I was hoping to get some assistance or documentation on some doubts i'm having.

I am trying to add the environment variable event hooks documented here on docker hub. But I believe in order to do so I need to modify the docker environment variables.

I was wondering if anyone could help me by pointing me in the right direction or with some documentation I can read up on to accomplish the following.

  1. I want to be able to stop the docker container without losing my game files / saved world.
  2. My understanding is that once I stop the container, I can then go in to "modify" the docker environment variables. I read on another issue posted that I can access the ECS files / docker container using AWS Transfer Family . I can handle that part, but will accessing this file system allow me to modify the docker file, and will I be able to ensure that I modify those files while the task/docker container is stopped?

Big thanks for any help in advance. 😄 spectacular work on this project!

Is public ip the only way to connect to your server?

I wanted to know if I missed something in configuration that would make my server show up in the public listing. Right now we are only able to connect via ip, which as we know resets every time I shut down the server and spin it back up. I wrote an api to return the task ip which is great (will be pushing to github soon for others to use), but it would be even easier to just connect in game.

Has anyone found a solution to getting the server name to show up on the in-game connection list? I see that my task environment var for Public_ip is set to 1≈true. I know sometimes AWS can be a little weird with typing.
Screen Shot 2021-04-02 at 8 43 44 AM

Has anyone successfully got their server to show up on the public listing? If so please, let me know!

This is amazing work @rileydakota thanks for the hours of fun so far!

Enhancement: Add example to README on how to access the lambdas

Forgive me I am an AWS noob, I assume to hit the lambdas for starting and stopping the server I would use API Gateway and Postman? However this looks likes it is expecting an auto token. Can you flesh out a bit of a guide in the FAQ's in the README perhaps?

I see the project hasn't been updated in a number of months. I think this is an amazing project and hope it doesn't fall to the wayside. Let me know how I can help if at all.

Question: why aws secret manager

Hey. First of all, thanks so much this was insanely helpful.

Anyway, I was curious why you were using aws secrets for the server password. It kept throwing errors for me about not being able to pull in the secret to set the password so I ended up removing all those calls and hardcoded it.

Thanks again!

Issue: CDK Creation gets stuck at Step 19/21

I'm trying to run the script and get something hosted on AWS, but I keep getting stuck at step 19/21 in the script. I'm not sure if I've changed variables incorrectly, but I thought I've been following the instructions and I'm not sure why it's stuck.

I'm pretty new to AWS so not entirely sure what's gone wrong here or what may be broken. If you'd like, I've included the output from my terminal window.

 16/21 | 3:54:47 PM | CREATE_COMPLETE      | AWS::EC2::Subnet                      | valheimVpc/valheimPublicSubnetSubnet1/Subnet (valheimVpcvalheimPublicSubnetSubnet1Subnet18E6AEBF)
 16/21 | 3:54:48 PM | CREATE_IN_PROGRESS   | AWS::EC2::Route                       | valheimVpc/valheimPublicSubnetSubnet1/DefaultRoute (valheimVpcvalheimPublicSubnetSubnet1DefaultRoute542839FB)
 16/21 | 3:54:48 PM | CREATE_IN_PROGRESS   | AWS::ECS::Service                     | valheimService/Service (valheimService6CC6232D)
 16/21 | 3:54:48 PM | CREATE_IN_PROGRESS   | AWS::EC2::Route                       | valheimVpc/valheimPublicSubnetSubnet1/DefaultRoute (valheimVpcvalheimPublicSubnetSubnet1DefaultRoute542839FB) Resource creation Initiated
 16/21 | 3:54:49 PM | CREATE_IN_PROGRESS   | AWS::EFS::MountTarget                 | valheimServerStorage/EfsMountTarget1 (valheimServerStorageEfsMountTarget1DCB920C3)
 16/21 | 3:54:49 PM | CREATE_IN_PROGRESS   | AWS::EC2::SubnetRouteTableAssociation | valheimVpc/valheimPublicSubnetSubnet1/RouteTableAssociation (valheimVpcvalheimPublicSubnetSubnet1RouteTableAssociation28A84AB8)
 16/21 | 3:54:49 PM | CREATE_IN_PROGRESS   | AWS::EC2::SubnetRouteTableAssociation | valheimVpc/valheimPublicSubnetSubnet1/RouteTableAssociation (valheimVpcvalheimPublicSubnetSubnet1RouteTableAssociation28A84AB8) Resource creation Initiated
 16/21 | 3:54:50 PM | CREATE_IN_PROGRESS   | AWS::EFS::MountTarget                 | valheimServerStorage/EfsMountTarget1 (valheimServerStorageEfsMountTarget1DCB920C3) Resource creation Initiated
 16/21 | 3:54:50 PM | CREATE_IN_PROGRESS   | AWS::ECS::Service                     | valheimService/Service (valheimService6CC6232D) Resource creation Initiated
 17/21 | 3:55:04 PM | CREATE_COMPLETE      | AWS::EC2::Route                       | valheimVpc/valheimPublicSubnetSubnet1/DefaultRoute (valheimVpcvalheimPublicSubnetSubnet1DefaultRoute542839FB)
 18/21 | 3:55:05 PM | CREATE_COMPLETE      | AWS::EC2::SubnetRouteTableAssociation | valheimVpc/valheimPublicSubnetSubnet1/RouteTableAssociation (valheimVpcvalheimPublicSubnetSubnet1RouteTableAssociation28A84AB8)
18/21 Currently in progress: ValheimServerAwsCdkStack, valheimService6CC6232D, valheimServerStorageEfsMountTarget1DCB920C3
 19/21 | 3:56:21 PM | CREATE_COMPLETE      | AWS::EFS::MountTarget                 | valheimServerStorage/EfsMountTarget1 (valheimServerStorageEfsMountTarget1DCB920C3)
19/21 Currently in progress: ValheimServerAwsCdkStack, valheimService6CC6232D

updownstatus API `startstop` endpoint has no effect

I've added as much info as possible here, not sure of the cause of the problem, but I've put my next thing to check in the "Hypotheses" section. I might have time to look at this later, but it might be the weekend before I can sit down to work this through. Any input appreciated!

Issue

After applying the fix in PR #33, the API endpoints appear to work, but in fact the startstop endpoint is having no effect on the desire count of the ECS service.

Recreate

  1. Deploy using code from PR #33
  2. Check server status - by looking at the AWS console or using the serverstatus endpoint - at this point if the status is "not running" the response is empty from the serverstatus endpoint:
curl --request GET 'https://[YOUR_API_GATEWAY_DOMAIN]/prod/serverstatus
  1. If the response is blank try starting the task:
curl --request GET 'https://[YOUR_API_GATEWAY_DOMAIN]/prod/startstop?key=[YOUR_API_PASSWORD_FROM_DOTENV_FILE]&desiredCount=1'

... else try to stop the task:

curl --request GET 'https://[YOUR_API_GATEWAY_DOMAIN]/prod/startstop?key=[YOUR_API_PASSWORD_FROM_DOTENV_FILE]&desiredCount=0'
  1. Check the status of the task again, either in the console or by using the API serverstatus endpoint.

Checks

Lambda Logs

The Lambda backing the startstop endpoint logs that it has made the update command - e.g.:

2023-01-20T00:05:18.106Z	732cdc88-f3e5-4a63-a2ac-a4b41237a9d5	INFO	starting service 
{
    "desiredCount": 1,
    "service": [SERVICE_ARN],
    "cluster": [CLUSTER_ARN]
}

and

2023-01-20T08:37:06.306Z	ca083a87-1c9f-4d5d-91d3-d0ddc1c9fd8f	INFO	changing desiredCount to 0
2023-01-20T08:37:06.389Z	ca083a87-1c9f-4d5d-91d3-d0ddc1c9fd8f	INFO	starting service 
{
    "desiredCount": 0,
    "service": [SERVICE_ARN],
    "cluster": [CLUSTER_ARN]
}

... but this is having no effect.

The code lines are:

const params = {
desiredCount: 1,
service: SERVICE_NAME,
cluster: CLUSTER_ARN
}

const updateCommand = new UpdateServiceCommand(params);
client.send(updateCommand).then(
(data) => {console.log(data);},
(err) => { console.log(err);}
);

These match up with use of the ECS client - docs here: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecs/classes/updateservicecommand.html

Updating cluster another way

As a sense check, you can use the aws cli to perform the same task:

aws ecs update-service --cluster [CLUSTER_ARN] --service [SERVICE_ARN] --desired-count [0|1]

After performing this command, the cluster responds. The serverstatus endpoint reflects the change and also the AWS console can be used to check, too.

This command is equivalent to what the Lambda is using - docs are here: https://docs.aws.amazon.com/cli/latest/reference/ecs/update-service.html

Hypotheses

  • Is this a permissions issue? Does the startstop lambda have the correct Role, security group, ..., whatever it needs, ..., to perform this task?
  • Something else ...?

modify adminlist.txt?

Hi! I'm trying to modify the adminlist.txt file. Is there a supported way to do this? I setup AWS Transfer Family, and I can sftp in, and download the file. However, I can't put ANY file into the directory. Any advice on how to fix these permissions? I should have a read/write role, unless I screwed something up.

What is the best way to suspend/resume server?

Hello! Thank you for your great job. I'm enjoying survival life with my friends.

I have a small experience around AWS, but new to ECS, Fargate, and CDK. I want to know the best way to stop servers to avoid being charged, and resume when we start playing again.

If you told me the instruction, I can add it to readme.

include target group and load balancer at service creation?

Hi! It looks like if you want to use an application load balancer for a fargate service, it needs to be created when you create the service.

After you create a service, the target group ARN or load balancer name, container name, and container port specified in the service definition are immutable. You cannot add, remove, or change the load balancer configuration of an existing service. If you update the task definition for the service, the container name and container port that were specified when the service was created must remain in the task definition.

Should this be added in some way? Thanks!

Next steps? IP address/connect to server questions

Hey there! I'm fairly inexperienced with AWS in general, but definitely haven't used ECS and CDK before!

I have ran the deployment script and I can see the container and stuff in ECS console. I think I'm missing a conceptual step - is this actually running the container and instance, or just creating the container image? Is there a manual step that needs to happen after the deploy?

If I go into ECS console -> Clusters I can see the Service and Task defined, but nothing under ECS Instances:
image

serverstatus and serverstartstop API Gateway Lambda fails

There seems to be some slight misconfiguration for the updownstatus API. The API responds with 500 and the Lambda logs show that the handler is not found:

{
    "errorType": "Runtime.HandlerNotFound",
    "errorMessage": "index.handler is undefined or not exported",
    "stack": [
        "Runtime.HandlerNotFound: index.handler is undefined or not exported",
        "    at UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1038:15)",
        "    at async start (file:///var/runtime/index.mjs:1200:23)",
        "    at async file:///var/runtime/index.mjs:1206:1"
    ]
}

Both endpoints are affected.

I'll take a look at this, but it'll be the earliest tomorrow.

Screenshot 2023-01-18 at 22 36 33

Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment

Hello @rileydakota , first of all, thankyou so much for your work, I'm kinda new to AWS and docker, so pardon my ignorance.
I got this message after I run npx cdk deploy --all

"Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment"

I searched on the net and it comes to the credentials so I went to set it through
aws configure and bootstrap it using ckd bootstrap --profile user1
I don't know where to ask really so i ask here, am i missing something?

Thanks for your help

'setuptools' distribution was not found

After deploying, my services keeps pending then stopping over and over again. Each time it stops for the same reason. I check the Event log and it says:
"pkg_resources.DistributionNotFound: The 'setuptools' distribution was not found and is required by supervisor". I'm using node 17.5.0 but this happened on an earlier version too.

full log here:
2022-02-17T23:54:39.940+00:00 INFO - Setting uid:gid of valheim to 0:0

2022-02-17T23:54:41.237+00:00 INFO - Setting timezone Etc/UTC

2022-02-17T23:54:41.237+00:00 INFO - Setting up syslogd - logging to stdout

2022-02-17T23:54:41.313+00:00 Traceback (most recent call last):

2022-02-17T23:54:41.313+00:00 File "/usr/local/bin/supervisord", line 6, in

2022-02-17T23:54:41.313+00:00 from pkg_resources import load_entry_point

2022-02-17T23:54:41.313+00:00 File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3191, in

2022-02-17T23:54:41.313+00:00 @_call_aside

2022-02-17T23:54:41.313+00:00 File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3175, in _call_aside

2022-02-17T23:54:41.313+00:00 f(*args, **kwargs)

2022-02-17T23:54:41.313+00:00 File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3204, in _initialize_master_working_set

2022-02-17T23:54:41.313+00:00 working_set = WorkingSet._build_master()

2022-02-17T23:54:41.313+00:00 File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 583, in _build_master

2022-02-17T23:54:41.313+00:00 ws.require(requires)

2022-02-17T23:54:41.313+00:00 File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 900, in require

2022-02-17T23:54:41.313+00:00 needed = self.resolve(parse_requirements(requirements))

2022-02-17T23:54:41.313+00:00 File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 786, in resolve

2022-02-17T23:54:41.313+00:00 raise DistributionNotFound(req, requirers)

2022-02-17T23:54:41.313+00:00 pkg_resources.DistributionNotFound: The 'setuptools' distribution was not found and is required by supervisor

"Error: EACCES: permission denied, lstat..." when deploying from git bash in Windows

I'm on Windows 10 Pro, with Docker for Windows running, and using git bash as my shell, and I was going through the steps in the README to deploy to a newly created sub-account (where cdk had already successfully bootstrapped), and got this output:

$ npx cdk --profile dbgames deploy --all
MFA token for arn:aws:iam::**********:mfa/******: ******
#1 [internal] load build definition from Dockerfile
#1 sha256:771197e9852863b46b3015849ef3bb4191be2a9598b28631de09f92b407b0aae
#1 transferring dockerfile: 32B done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 sha256:00052d643de5318aa5bb4f51e8f2201818735e97b10a673293f57c134a40c83c
#2 transferring context: 2B done
#2 DONE 0.1s

#3 [internal] load metadata for docker.io/amazon/aws-sam-cli-build-image-nodejs10.x:latest
#3 sha256:22b94e7432981cb8a0273982fb3d66047200fe5f906a4417fb0e377004adb91e
#3 ...

#4 [auth] amazon/aws-sam-cli-build-image-nodejs10.x:pull token for registry-1.docker.io
#4 sha256:3bfcb5c23d336051e072380562237c3f22665825c675b0b859b8b0e08ddce5ef
#4 DONE 0.0s

#3 [internal] load metadata for docker.io/amazon/aws-sam-cli-build-image-nodejs10.x:latest
#3 sha256:22b94e7432981cb8a0273982fb3d66047200fe5f906a4417fb0e377004adb91e
#3 DONE 0.8s

#5 [1/7] FROM docker.io/amazon/aws-sam-cli-build-image-nodejs10.x@sha256:e57fba80c9947cb56fce236f735fc65a12c34c400ee47d2296d4216c35a4429b
#5 sha256:2aa847f18adf0c41aa02703c2376edbdc3bf3c2fdb6326741e7889ab15fa7855
#5 DONE 0.0s

#6 [2/7] RUN npm install --global [email protected]
#6 sha256:ede7833aa5ed3ed4b41fce2d978f9ec70dc20aec7b72851cad683a8de785f0ea
#6 CACHED

#9 [5/7] RUN mkdir /tmp/yarn-cache &&     chmod -R 777 /tmp/yarn-cache &&     yarn config set cache-folder /tmp/yarn-cache
#9 sha256:e349bf4b05ac7b0ab5b2713cfdd87bbaa1bd29aecc938f88bff13527b86efc2d
#9 CACHED

#8 [4/7] RUN mkdir /tmp/npm-cache &&     chmod -R 777 /tmp/npm-cache &&     npm config --global set cache /tmp/npm-cache
#8 sha256:0e02bc797552de67f9baba5a1c08178fa8b23b7d3a635d22b2319e57070c5797
#8 CACHED

#10 [6/7] RUN npm config --global set update-notifier false
#10 sha256:ced028c5d4ad17bdcdf3ad167267c5a79e823e8fbf330bc3a53016eb28f06b2a
#10 CACHED

#7 [3/7] RUN npm install --global --unsafe-perm=true esbuild@0
#7 sha256:23485a70c1684d55c64f90ff3460dcff3c4ff00293e4b9941a22926f888bf185
#7 CACHED

#11 [7/7] RUN /sbin/useradd -u 1000 user && chmod 711 /
#11 sha256:582fdda1f0e33b54899f1bdac55a7a7212cd0375b446a1aedd561dc04e5342af
#11 CACHED

#12 exporting to image
#12 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#12 exporting layers done
#12 writing image sha256:0380b4014721dd01201a913cf90d288fa57ac1500d204155e231616fb5a9dc5c done
#12 naming to docker.io/library/cdk-f4fe827154c06ccd25db709d24f041465d2a39fa3905b67ac145c7ee4fce87c7
#12 naming to docker.io/library/cdk-f4fe827154c06ccd25db709d24f041465d2a39fa3905b67ac145c7ee4fce87c7 done
#12 DONE 0.1s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Bundling asset LambdaEcsFargateUpdownstatusStack/Status/serverStatus/Code/Stage...
esbuild cannot run locally. Switching to Docker bundling.

  asset-output/index.js  2.4kb

⚡ Done in 14ms

> [email protected] postinstall /asset-output/node_modules/fast-xml-parser
> node tasks/postinstall.js || exit 0

Love fast-xml-parser? Check https://amitkumargupta.work for more projects and contribution.

npm WARN asset-output No description
npm WARN asset-output No repository field.
npm WARN asset-output No license field.

added 115 packages from 18 contributors and audited 115 packages in 19.133s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Error: EACCES: permission denied, lstat 'D:\dev\valheim-ecs-fargate-cdk\cdk.out\bundling-temp-b32470dec8d31066aa9a5bfbe41ec61a57ab003f69ae2eda0d92c8b99543c39d\node_modules\.bin\xml2js'
    at Object.lstatSync (fs.js:1115:3)
    at _processFileOrDirectory (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\fs\fingerprint.ts:56:21)
    at _processFileOrDirectory (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\fs\fingerprint.ts:70:9)
    at _processFileOrDirectory (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\fs\fingerprint.ts:70:9)
    at _processFileOrDirectory (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\fs\fingerprint.ts:70:9)
    at Object.fingerprint (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\fs\fingerprint.ts:45:3)
    at Function.fingerprint (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\fs\index.ts:38:12)
    at AssetStaging.calculateHash (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\asset-staging.ts:507:27)
    at AssetStaging.stageByBundling (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\asset-staging.ts:337:35)
    at stageThisAsset (D:\dev\valheim-ecs-fargate-cdk\node_modules\@aws-cdk\core\lib\asset-staging.ts:196:35)
Subprocess exited with error 1

No export named fargateClusterName found

Trying to get these stacks deployed following the instructions. The first stack deploys ("ValheimServerAwsCdkStack") but the second stack ("LambdaEcsFargateUpdownstatusStack") fails with:

No export named fargateClusterName found

I've looked in the codebase and indeed I see the parameter imported in valheim-server-aws-cdk.ts, but no reference outside of this file.

Should this parameter be exported by the other stack?

Any ideas of what's going on here would be appreciated! If you need more info, let me know!!!

I'll look into this myself, as I've some experience with AWS and CDK; however, I've been generally using the Python API for CDK, and Typescript is a second language to me. Any shortcuts would be helpful!

Having issue to start Fargate - Stuck on 19/21

First of all thanks for making this!

I think I followed the guide thoroughly but I am having this error when ever a task is being started on my fargate

ResourceInitializationError: unable to pull secrets or registry auth: execution resource retrieval failed: unable to retrieve secret from asm: service call has been retried 1 time(s): invalid character '\'' looking for beginning of value

I check every where but I am not sure where this '' character coming from?

thank you verch much for the help!

Add instructions/capability for importing an existing map file

It would be ideal for people who already have a server and want to use the solution to either:

A) have a native method in the CDK template to specify an existing server volume and have it uploaded to the EFS Volume (Cloudformation Custom Resource?)

or
B) Provide an AWS CLI Script in the README that allows a user to do this.

Recommended method would be to utilize AWS Transfer Family and tear it down after the upload: https://aws.amazon.com/blogs/aws/new-aws-transfer-family-support-for-amazon-elastic-file-system/

Improve EFS mounting process

Currently, when a new cluster is created, there will be 3-4 tasks that fail to start because they cannot mount EFS. Eg.:
Resourceinitializationerror: failed to invoke EFS utils commands to set up EFS volumes: stderr: Failed to resolve "fs-<id>.efs.us-east-1.amazonaws.com" - check that your file system ID is correct, and ensure that the VPC has an EFS mount target for this file system ID. See https://docs.aws.amazon.com/console/efs/mount-dns-name for more detail. Attempting to lookup mount target ip address using botocore. Failed to import necessary dependency botocore, please install botocore first. : unsuccessful EFS utils command execution; code: 1

  • Only happens when a new EFS file system is created
  • Cannot just add a delay, because then we'd artificially add delay when it would be working normally

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.