route53

package
v0.0.1-alpha.37 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package route53 emulates Amazon Route 53: hosted zones, resource record sets, tags, and health checks exist as real metadata with AWS-faithful validation, defaults, and error codes, and — since issue #1189 — Overcast's own DNS resolver (internal/dns) actually answers queries from them. See dns_resolve.go for the resolver integration and docs/services/route53.md for what is and is not served.

Implemented operations (REST-XML at /2013-04-01/):

Hosted zones:   CreateHostedZone, GetHostedZone, ListHostedZones,
                ListHostedZonesByName, GetHostedZoneCount,
                UpdateHostedZoneComment, DeleteHostedZone
Record sets:    ChangeResourceRecordSets, ListResourceRecordSets
Changes:        GetChange
Tags:           ChangeTagsForResource, ListTagsForResource, ListTagsForResources
Health checks:  CreateHealthCheck, GetHealthCheck, ListHealthChecks,
                GetHealthCheckCount, UpdateHealthCheck, DeleteHealthCheck

Route 53 is a global service — resources are stored without a region key. Documented divergences: ChangeResourceRecordSets applies synchronously, so change status is INSYNC immediately (no PENDING phase), and GetChange returns INSYNC for unknown change IDs instead of NoSuchChange so that CDK/CLI waiters always converge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlarmIdentifier

type AlarmIdentifier struct {
	Region string `json:"Region" xml:"Region"`
	Name   string `json:"Name" xml:"Name"`
}

AlarmIdentifier names the CloudWatch alarm backing a CLOUDWATCH_METRIC check.

type GeoLocation

type GeoLocation struct {
	ContinentCode   string `json:"ContinentCode,omitempty" xml:"ContinentCode,omitempty"`
	CountryCode     string `json:"CountryCode,omitempty" xml:"CountryCode,omitempty"`
	SubdivisionCode string `json:"SubdivisionCode,omitempty" xml:"SubdivisionCode,omitempty"`
}

GeoLocation mirrors the Route 53 GeoLocation shape on geolocation records.

type HealthCheck

type HealthCheck struct {
	Id              string            `json:"Id"`
	CallerReference string            `json:"CallerReference"`
	CreatedAt       time.Time         `json:"CreatedAt"`
	Version         int64             `json:"Version"`
	Config          HealthCheckConfig `json:"Config"`
}

HealthCheck represents a Route 53 health check.

type HealthCheckConfig

type HealthCheckConfig struct {
	IPAddress                    string           `json:"IPAddress,omitempty" xml:"IPAddress,omitempty"`
	Port                         int              `json:"Port,omitempty" xml:"Port,omitempty"`
	Type                         string           `json:"Type" xml:"Type"`
	ResourcePath                 string           `json:"ResourcePath,omitempty" xml:"ResourcePath,omitempty"`
	FullyQualifiedDomainName     string           `json:"FullyQualifiedDomainName,omitempty" xml:"FullyQualifiedDomainName,omitempty"`
	SearchString                 string           `json:"SearchString,omitempty" xml:"SearchString,omitempty"`
	RequestInterval              int              `json:"RequestInterval,omitempty" xml:"RequestInterval,omitempty"`
	FailureThreshold             int              `json:"FailureThreshold,omitempty" xml:"FailureThreshold,omitempty"`
	MeasureLatency               *bool            `json:"MeasureLatency,omitempty" xml:"MeasureLatency,omitempty"`
	Inverted                     *bool            `json:"Inverted,omitempty" xml:"Inverted,omitempty"`
	Disabled                     *bool            `json:"Disabled,omitempty" xml:"Disabled,omitempty"`
	HealthThreshold              *int             `json:"HealthThreshold,omitempty" xml:"HealthThreshold,omitempty"`
	ChildHealthChecks            []string         `json:"ChildHealthChecks,omitempty" xml:"ChildHealthChecks>ChildHealthCheck,omitempty"`
	EnableSNI                    *bool            `json:"EnableSNI,omitempty" xml:"EnableSNI,omitempty"`
	Regions                      []string         `json:"Regions,omitempty" xml:"Regions>Region,omitempty"`
	AlarmIdentifier              *AlarmIdentifier `json:"AlarmIdentifier,omitempty" xml:"AlarmIdentifier,omitempty"`
	InsufficientDataHealthStatus string           `json:"InsufficientDataHealthStatus,omitempty" xml:"InsufficientDataHealthStatus,omitempty"`
	RoutingControlArn            string           `json:"RoutingControlArn,omitempty" xml:"RoutingControlArn,omitempty"`
}

HealthCheckConfig carries the health check configuration. The struct is shared between the wire format and persistence; field order matches the element order AWS emits.

type HostedZone

type HostedZone struct {
	Id              string    `json:"Id"` // AWS path form: /hostedzone/Z...
	Name            string    `json:"Name"`
	CallerReference string    `json:"CallerReference"`
	CreatedAt       time.Time `json:"CreatedAt"`
	Comment         string    `json:"Comment,omitempty"`
	PrivateZone     bool      `json:"PrivateZone"`
	NameServers     []string  `json:"NameServers,omitempty"`
	VPCs            []VPC     `json:"VPCs,omitempty"`
}

HostedZone represents a Route 53 hosted zone.

type ResourceRecordSet

type ResourceRecordSet struct {
	Name             string       `json:"Name"`
	Type             string       `json:"Type"`
	SetIdentifier    string       `json:"SetIdentifier,omitempty"`
	TTL              int64        `json:"TTL"`
	ResourceRecords  []string     `json:"ResourceRecords"`
	Weight           *int64       `json:"Weight,omitempty"`
	Region           string       `json:"Region,omitempty"`
	Failover         string       `json:"Failover,omitempty"`
	MultiValueAnswer *bool        `json:"MultiValueAnswer,omitempty"`
	GeoLocation      *GeoLocation `json:"GeoLocation,omitempty"`
	HealthCheckId    string       `json:"HealthCheckId,omitempty"`
	// AliasTarget fields
	AliasHostedZoneId         string `json:"AliasHostedZoneId,omitempty"`
	AliasDNSName              string `json:"AliasDNSName,omitempty"`
	AliasEvaluateTargetHealth bool   `json:"AliasEvaluateTargetHealth,omitempty"`
}

ResourceRecordSet represents a DNS record set in a hosted zone. Alias fields stay flattened for JSON compatibility with earlier releases.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements router.Service for Route 53.

func New

func New(cfg *config.Config, st state.Store, logger *zap.Logger, clk clock.Clock) *Service

New returns a configured Route 53 service.

func (*Service) DispatchQuery

func (s *Service) DispatchQuery(w http.ResponseWriter, r *http.Request)

DispatchQuery satisfies router.QueryDispatcher. Route 53 natively uses REST-XML (path-based routing), but the typed operations also accept Query-protocol form-encoded POST requests with Action fields.

func (*Service) Lookup

func (s *Service) Lookup(ctx context.Context, qname string, qtype uint16) (dns.Route53Answer, bool)

Lookup implements dns.Route53Source: it is what makes the DNS resolver treat this service's store as authoritative for the zones it holds.

func (*Service) Name

func (s *Service) Name() string

func (*Service) Operations

func (s *Service) Operations() []op.Operation

func (*Service) OwnsAction

func (s *Service) OwnsAction(action string) bool

OwnsAction satisfies router.QueryActionOwner.

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(r chi.Router)

func (*Service) SupportedProtocols

func (s *Service) SupportedProtocols() []codec.Codec

type Tag

type Tag struct {
	Key   string `xml:"Key"`
	Value string `xml:"Value"`
}

Tag is a Route 53 resource tag.

type VPC

type VPC struct {
	VPCRegion string `json:"VPCRegion" xml:"VPCRegion"`
	VPCId     string `json:"VPCId" xml:"VPCId"`
}

VPC identifies a VPC associated with a private hosted zone.

Jump to

Keyboard shortcuts

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