An open API service indexing awesome lists of open source software.

https://github.com/zcemycl/aws-serverless-ddns-terraform

Deployment of DDNS into AWS resources through terraform
https://github.com/zcemycl/aws-serverless-ddns-terraform

apigateway apikey aws aws-dynamodb aws-lambda aws-route53 boto3 cloudwatch-logs dynamodb nosql nosql-database python terraform

Last synced: 2 months ago
JSON representation

Deployment of DDNS into AWS resources through terraform

Awesome Lists containing this project

README

        

# aws-serverless-ddns-terraform
The repository to deploy ddns through terraform into aws environment, using API Gateway, Route53 and Lambda. It implements the architecture suggested by [Building a serverless dynamic DNS system with AWS](https://aws.amazon.com/blogs/startups/how-to-build-a-serverless-dynamic-dns-system-with-aws/#:~:text=AWS%20Services%20We%20Use%20in%20Our%20Dynamic%20DNS%20system&text=Your%20code%20is%20always%20ready,events%20from%20other%20AWS%20services) and improves it by introducing API-Gateway so DDNS is protected away from non-intended users.

![architecture](resources/architecture.png)

## How to run?
1. Set up the infrastructure by terraform.
```bash
cd architecture
terraform init
terraform apply -auto-approve
```
2. Export environment variables for python script.
```bash
export APIGW_INVOKE_URI=
export X_API_KEY=
```
3. Run cronjob to regularly update. `python src/local/main.py`
```bash
# linux
sudo apt update
sudo apt install cron
# macos -> need permission settings
brew install cron

# common after installation
crontab -e
# add this
*/2 * * * * APIGW_INVOKE_URI= X_API_KEY= python src/local/main.py >> log.txt 2>&1
```

### References
1. https://www.youtube.com/watch?v=yzT92pEcIvM
2. https://aws.amazon.com/blogs/startups/how-to-build-a-serverless-dynamic-dns-system-with-aws/#:~:text=AWS%20Services%20We%20Use%20in%20Our%20Dynamic%20DNS%20system&text=Your%20code%20is%20always%20ready,events%20from%20other%20AWS%20services.
3. https://www.bejarano.io/fixing-cron-jobs-in-mojave/