Dynamic DNS API usage with AWS Lambda
module "ddns" {
source = "[email protected]:terraform-frankywahl-modules/terraform-ddns53.git"
domain = "example.com" # Assumes you alread created the hosted zone with this domain
subdomain = "home"
enable_cloudwatch = true
}
This creates a Route53 record (home.example.com
), an API Gateway and Lambda that that will allow updating that record.
- API Gateway acts as a full proxy
- Username and Password are stored as environment variables on the lambda. Please use those when configuring the service with DynDNS
- Since there is no way of knowing if the binary was changed or not, the go binary will be recreated on every deploy
References that were used to help create this module:
- https://aws.amazon.com/blogs/startups/how-to-build-a-serverless-dynamic-dns-system-with-aws/
- https://github.com/sTywin/dyndns53
- https://github.com/jcmturner/ddns
Name | Version |
---|---|
archive | 2.2.0 |
aws | 4.13.0 |
null | 3.1.1 |
random | 3.1.3 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
domain | The TLD of the domain we want to create a DDNS for | string |
n/a | yes |
enable_cloudwatch | Enable Lambda to log cloudwatch events | bool |
true |
no |
password | Password for the basic authentication. One will be created if none are given | string |
null |
no |
subdomain | The subdomain that needs to be updated with DDNS | string |
"home" |
no |
tags | A mapping of tags to assign to the resources created | map(string) |
{} |
no |
username | Username for the basic authentication. One will be created if none are given | string |
null |
no |
Name | Description |
---|---|
password | The password to use for basic authentication of the endpoint |
url | The URL where the endpoint can be invoked |
username | The username to use for basic authentication of the endpoint |