Skip to content

terraform-frankywahl-modules/terraform-ddns53

Repository files navigation

Dynamic DNS & AWS

Dynamic DNS API usage with AWS Lambda

Usage

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.

Notes

  • 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

Requirements

  • Go - for compiling the soure code
  • Terraform
  • AWS account with an existent hosted zone

References

References that were used to help create this module:

Providers

Name Version
archive 2.2.0
aws 4.13.0
null 3.1.1
random 3.1.3

Resources

Name Type
aws_api_gateway_deployment.deployment resource
aws_api_gateway_integration.options_integration resource
aws_api_gateway_integration.request_integration resource
aws_api_gateway_integration.request_integration_root resource
aws_api_gateway_integration_response.options_integration_response resource
aws_api_gateway_method.options_method resource
aws_api_gateway_method.request_method resource
aws_api_gateway_method.request_method_root resource
aws_api_gateway_method_response.options_200 resource
aws_api_gateway_resource.proxy resource
aws_api_gateway_rest_api.api resource
aws_iam_policy.lambda_policy resource
aws_iam_role.lambda_role resource
aws_iam_role_policy.lambda resource
aws_iam_role_policy_attachment.cloudwatch resource
aws_lambda_function.main resource
aws_lambda_permission.allow_api_gateway resource
aws_route53_record.ddns resource
null_resource.artifact resource
random_password.password resource
random_string.username resource
archive_file.artifact data source
aws_iam_policy.cloudwatch data source
aws_route53_zone.domain data source

Inputs

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

Outputs

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

About

DynamicDNS with AWS Route 53

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published