Skip to content

Commit

Permalink
Add .cdk.context.json to .npmignore and update README.md and package.…
Browse files Browse the repository at this point in the history
…json
  • Loading branch information
agadzik committed Jan 31, 2024
1 parent 03f3a32 commit 1169b28
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 12 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# CDK asset staging directory
.cdk.staging
cdk.out
cdk.context.json
67 changes: 57 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,61 @@
# Welcome to your CDK TypeScript project
# palworld-server-cdk

This is a blank project for CDK development with TypeScript.
## Description

The `cdk.json` file tells the CDK Toolkit how to execute your app.
Use AWS CDK to provision the infrastructure for a dedicated Palworld server using EFS with ECS and Fargate. Also includes a simple HTTP API using API Gateway and Lambda to add Discord interactions to any Discord server you manage.

## Useful commands
## Installation

* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `npx cdk deploy` deploy this stack to your default AWS account/region
* `npx cdk diff` compare deployed stack with current state
* `npx cdk synth` emits the synthesized CloudFormation template
To get started, install the AWS CDK.

```bash
pnpm install -g aws-cdk
# or
npm install -g aws-cdk
# or
yarn global add aws-cdk
```

Then, install the dependencies.

```bash
pnpm install
# or
npm install
# or
yarn
```

Next, you need to configure your AWS credentials by following the instructions [here](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_auth).

Finally, you need to bootstrap your AWS environment.

```bash
cdk bootstrap --profile <your-profile-name>
```

### Discord Setup

If you want to support Discord interactions, you need to create a Discord application and bot. Follow the instructions [here](https://discord.com/developers/docs/getting-started) to create a new application and bot.

It's important to give your bot permissions to `appplications.commands` and `bot`.

Once your application bot has been created and added to your Discord server, store the `public key` value as an environment variable named `APPLICATION_PUBLIC_KEY`.

## Usage

In order to deploy the infrastructure, you need to run the following command.

```bash
APPLICATION_PUBLIC_KEY=<your-discord-app-public-key> AWS_ACCOUNT=<your-account-number> cdk deploy --profile <your-profile-name>
```

For the first install, select `y` to approve the creation of the CloudFormation stack.

## Contributing

All PRs are welcome!

## License

This project is licensed under the MIT License.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "cdk-palworld",
"version": "0.1.0",
"description": "Use AWS CDK to provision infrastructure for a dedicated PalWorld server",
"license": "MIT",
"author": "[email protected]",
"bin": {
"cdk-palworld": "bin/cdk-palworld.js"
"cdk-palworld": "bin/app.js"
},
"scripts": {
"build": "tsc",
Expand Down Expand Up @@ -30,4 +33,4 @@
"serverless-http": "^3.2.0",
"source-map-support": "^0.5.21"
}
}
}

0 comments on commit 1169b28

Please sign in to comment.