Skip to content
/ api Public

SJ57 REST API; aws cdk project

License

Notifications You must be signed in to change notification settings

sj57/api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SJ57 API

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.

Requirements

  • AWS CLI
  • AWS CDK
  • Python 3

Environment Variables

The following environment variables must be set before deploying the stack:

  • DISCORD_WEBHOOK: Discord webhook URL for sending notifications
  • AWS_REGION: AWS region to deploy the stack to
  • AWS_ACCESS_KEY_ID: AWS access key ID with permissions to deploy the stack
  • AWS_SECRET_ACCESS_KEY: AWS secret access key corresponding to the access key ID
  • AWS_CDK_ACCOUNT_ID: AWS account ID for the stack

Deployment

  1. Run cdk synth to generate the CloudFormation template
  2. Run cdk deploy --require-approval never to deploy the stack

Testing

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).

About

SJ57 REST API; aws cdk project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages