-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .cdk.context.json to .npmignore and update README.md and package.…
…json
- Loading branch information
Showing
3 changed files
with
63 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
# CDK asset staging directory | ||
.cdk.staging | ||
cdk.out | ||
cdk.context.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
@@ -30,4 +33,4 @@ | |
"serverless-http": "^3.2.0", | ||
"source-map-support": "^0.5.21" | ||
} | ||
} | ||
} |