This is a Python 3 CDK project that deploys a REST API to AWS. The API has a single endpoint which invokes a Lambda function to open a garage door.
- AWS CLI
- AWS CDK
- Python 3
The following environment variables must be set before deploying the stack:
DISCORD_WEBHOOK: Discord webhook URL for sending notificationsAWS_REGION: AWS region to deploy the stack toAWS_ACCESS_KEY_ID: AWS access key ID with permissions to deploy the stackAWS_SECRET_ACCESS_KEY: AWS secret access key corresponding to the access key IDAWS_CDK_ACCOUNT_ID: AWS account ID for the stack
- Run
cdk synthto generate the CloudFormation template - Run
cdk deploy --require-approval neverto deploy the stack
To test the API, send a POST request to the /open-garage endpoint with an empty body. A notification will be sent to the Discord webhook specified in the DISCORD_WEBHOOK environment variable and the garage door will be opened (if it is connected to the system).