Setup
This project requires virtual environment to manage dependencies. This project has built with Python 3.11.
How to create virtual environment
# create virtual environment
python3 -m venv venv
# activate virtual environment using shell script
source activate_venv.sh
# install all dependencies
pip install -r requirements.txt
AWS Deployment
A GitHub Actions workflow automatically deploys the DiscordBotLambdaStack when changes are pushed to the main branch. The workflow is defined in .github/workflows/deploy-lambda.yml and performs the following steps:
- Checks out the repository and sets up Node.js.
- Installs Node dependencies with
npm ci. - Configures AWS credentials using
aws-actions/configure-aws-credentials@v4. - Runs
npx cdk deploy --require-approval neverto deploy the stack.
Create these repository secrets so the workflow can authenticate with AWS:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGION
The Lambda code relies on environment variables stored in .env. Refer to .env.example for the variables that must be provided.