Help us shape the future of Go! Take the 2026 Go Developer Survey

route53

package module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 5 Imported by: 2

README

Route53 module for Caddy

This package contains a DNS provider module for Caddy. It can be used to manage DNS records in Route53 Hosted zones.

Caddy module name

dns.providers.route53

Authenticating

See the associated README in the libdns package for important information about credentials and an IAM policy example.

Building

To compile this Caddy module, follow the steps describe at the Caddy Build from Source instructions and import the github.com/caddy-dns/route53 plugin

Config examples

This module supports all the credential configuration methods described in the AWS Developer Guide, such as Environment Variables, Shared configuration files, the AWS Credentials file located in .aws/credentials, and Static Credentials. You may also pass in static credentials directly (or via caddy's configuration).

To use this module for the ACME DNS challenge, configure the ACME issuer in your Caddy JSON like so:

{
  "module": "acme",
  "challenges": {
    "dns": {
      "provider": {
        "name": "route53",
        "max_retries": 10, // optional
        "profile": "real-profile", // optional
        "region": "us-east-1", // optional
        "access_key_id": "AKI...", // optional
        "secret_access_key": "wJa...", // optional
        "session_token": "TOKEN...", // optional
        "max_wait_dur": 60, // propagation wait duration (optional)
        "wait_for_propagation": false, // wait for records to propagate (optional)
        "hosted_zone_id": "ZABCD1EFGHIL" // AWS hosted zone ID to update (optional)
      }
    }
  }
}

or with the Caddyfile:

tls {
  dns route53 {
    max_retries 10 // optional
    profile "real-profile" // optional
    access_key_id "AKI..." // optional
    secret_access_key "wJa..." // optional
    session_token "TOKEN..." // optional
    region "us-east-1" // optional
    max_wait_dur 60, // propagation wait duration (optional)
    wait_for_propagation false // wait for records to propagate (optional)
    hosted_zone_id ZABCD1EFGHIL // AWS hosted zone ID to update (optional)
  }
}

The following IAM policy is a minimal working example to give libdns permissions to manage DNS records:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Action": [
        "route53:ListResourceRecordSets",
        "route53:GetChange",
        "route53:ChangeResourceRecordSets"
      ],
      "Resource": [
        "arn:aws:route53:::hostedzone/ZABCD1EFGHIL",
        "arn:aws:route53:::change/*"
      ]
    },
    {
      "Sid": "",
      "Effect": "Allow",
      "Action": ["route53:ListHostedZonesByName", "route53:ListHostedZones"],
      "Resource": "*"
    }
  ]
}

For more information, refer to libdns/route53.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{ *route53.Provider }

Provider wraps the provider implementation as a Caddy module.

func (Provider) CaddyModule

func (Provider) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Provider) Provision

func (p *Provider) Provision(ctx caddy.Context) error

Provision implements the Provisioner interface to initialize the AWS Client

func (*Provider) UnmarshalCaddyfile

func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax:

route53 {
	region <string>
	profile <string>
	access_key_id <string>
	secret_access_key <string>
	session_token <string>
	max_retries <int>
	max_wait_dur <int>
	wait_for_propagation <bool>
	hosted_zone_id <string>
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL