Documentation
¶
Index ¶
- Variables
- type AlarmIdentifier
- type AliasTarget
- type Change
- type ChangeAction
- type ChangeInfo
- type CidrCollection
- type CidrCollectionChange
- type CidrRoutingConfig
- type DNSQueryContext
- type DNSRegistrar
- type FailoverPolicy
- type GeoLocation
- type GeoProximityCoordinates
- type GeoProximityLocation
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) IAMAction(r *http.Request) string
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type HealthCheck
- type HealthCheckConfig
- type HealthCheckObservation
- type HealthCheckType
- type HostedZone
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) ActivateKeySigningKey(hostedZoneID, name string) (*KeySigningKey, error)
- func (b *InMemoryBackend) AddHealthCheckInternal(hc HealthCheck)
- func (b *InMemoryBackend) AddKeySigningKeyInternal(ksk KeySigningKey)
- func (b *InMemoryBackend) AddTrafficPolicyInternal(tp TrafficPolicy)
- func (b *InMemoryBackend) AddZoneInternal(hz HostedZone)
- func (b *InMemoryBackend) AssociateVPCWithHostedZone(zoneID, vpcID, vpcRegion string) error
- func (b *InMemoryBackend) ChangeCidrCollection(collectionID string, changes []CidrCollectionChange, expectedVersion *int64) (*CidrCollection, error)
- func (b *InMemoryBackend) ChangeResourceRecordSets(zoneID string, changes []Change) (string, error)
- func (b *InMemoryBackend) ChangeTagsForResource(resourceType, resourceID string, addTags map[string]string, ...) error
- func (b *InMemoryBackend) CountAssociatedVPCs(zoneID string) (int, error)
- func (b *InMemoryBackend) CountResourceRecordSets(zoneID string) (int, error)
- func (b *InMemoryBackend) CountZonesByReusableDelegationSet(id string) (int, error)
- func (b *InMemoryBackend) CreateCidrCollection(name, _ string) (*CidrCollection, error)
- func (b *InMemoryBackend) CreateHealthCheck(callerRef string, cfg HealthCheckConfig) (*HealthCheck, error)
- func (b *InMemoryBackend) CreateHostedZone(name, callerRef, comment string, private bool, delegationSetID string) (*HostedZone, error)
- func (b *InMemoryBackend) CreateKeySigningKey(hostedZoneID, _, name, kmsArn, status string) (*KeySigningKey, error)
- func (b *InMemoryBackend) CreateQueryLoggingConfig(hostedZoneID, logGroupArn string) (*QueryLoggingConfig, error)
- func (b *InMemoryBackend) CreateReusableDelegationSet(callerRef, hostedZoneID string) (*ReusableDelegationSet, error)
- func (b *InMemoryBackend) CreateTrafficPolicy(name, document, comment string) (*TrafficPolicy, error)
- func (b *InMemoryBackend) CreateTrafficPolicyInstance(hostedZoneID, name, tpID string, tpVersion int32, ttl int64) (*TrafficPolicyInstance, error)
- func (b *InMemoryBackend) CreateTrafficPolicyVersion(id, document, comment string) (*TrafficPolicy, error)
- func (b *InMemoryBackend) CreateVPCAssociationAuthorization(zoneID, vpcID, vpcRegion string) (*VPCAssociationAuthorization, error)
- func (b *InMemoryBackend) DeactivateKeySigningKey(hostedZoneID, name string) (*KeySigningKey, error)
- func (b *InMemoryBackend) DeleteCidrCollection(id string) error
- func (b *InMemoryBackend) DeleteHealthCheck(id string) error
- func (b *InMemoryBackend) DeleteHostedZone(zoneID string) error
- func (b *InMemoryBackend) DeleteKeySigningKey(hostedZoneID, name string) error
- func (b *InMemoryBackend) DeleteQueryLoggingConfig(id string) error
- func (b *InMemoryBackend) DeleteReusableDelegationSet(id string) error
- func (b *InMemoryBackend) DeleteTrafficPolicy(id string, version int32) error
- func (b *InMemoryBackend) DeleteTrafficPolicyInstance(id string) error
- func (b *InMemoryBackend) DeleteVPCAssociationAuthorization(zoneID, vpcID string) error
- func (b *InMemoryBackend) DisableHostedZoneDNSSEC(zoneID string) error
- func (b *InMemoryBackend) DisassociateVPCFromHostedZone(zoneID, vpcID string) error
- func (b *InMemoryBackend) EnableHostedZoneDNSSEC(zoneID string) error
- func (b *InMemoryBackend) GetChange(changeID string) (*ChangeInfo, error)
- func (b *InMemoryBackend) GetDNSSEC(zoneID string) (bool, []KeySigningKey, error)
- func (b *InMemoryBackend) GetHealthCheck(id string) (*HealthCheck, error)
- func (b *InMemoryBackend) GetHealthCheckCount() int
- func (b *InMemoryBackend) GetHealthCheckStatus(id string) (string, error)
- func (b *InMemoryBackend) GetHostedZone(zoneID string) (*HostedZone, error)
- func (b *InMemoryBackend) GetHostedZoneCount() int
- func (b *InMemoryBackend) GetQueryLoggingConfig(id string) (*QueryLoggingConfig, error)
- func (b *InMemoryBackend) GetReusableDelegationSet(id string) (*ReusableDelegationSet, error)
- func (b *InMemoryBackend) GetTrafficPolicy(id string, version int32) (*TrafficPolicy, error)
- func (b *InMemoryBackend) GetTrafficPolicyInstance(id string) (*TrafficPolicyInstance, error)
- func (b *InMemoryBackend) ListCidrBlocks(collectionID, locationName string) ([]string, error)
- func (b *InMemoryBackend) ListCidrCollections() ([]*CidrCollection, error)
- func (b *InMemoryBackend) ListCidrLocations(collectionID string) ([]string, error)
- func (b *InMemoryBackend) ListHealthChecks(marker string, maxItems int) (page.Page[HealthCheck], error)
- func (b *InMemoryBackend) ListHostedZones(marker string, maxItems int) (page.Page[HostedZone], error)
- func (b *InMemoryBackend) ListHostedZonesByName(dnsName, zoneID string, maxItems int) ([]HostedZone, string, string, error)
- func (b *InMemoryBackend) ListHostedZonesByVPC(vpcID, vpcRegion string) ([]HostedZone, error)
- func (b *InMemoryBackend) ListQueryLoggingConfigs(hostedZoneID string) ([]*QueryLoggingConfig, error)
- func (b *InMemoryBackend) ListResourceRecordSets(zoneID, startName, startType, startIdentifier string, maxItems int) (RRSetPage, error)
- func (b *InMemoryBackend) ListReusableDelegationSets() ([]*ReusableDelegationSet, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceType, resourceID string) (map[string]string, error)
- func (b *InMemoryBackend) ListTagsForResources(resourceType string, resourceIDs []string) (map[string]map[string]string, error)
- func (b *InMemoryBackend) ListTrafficPolicies() ([]*TrafficPolicySummary, error)
- func (b *InMemoryBackend) ListTrafficPolicyInstances() ([]*TrafficPolicyInstance, error)
- func (b *InMemoryBackend) ListTrafficPolicyInstancesByHostedZone(hostedZoneID string) ([]*TrafficPolicyInstance, error)
- func (b *InMemoryBackend) ListTrafficPolicyInstancesByPolicy(tpID string, tpVersion int32) ([]*TrafficPolicyInstance, error)
- func (b *InMemoryBackend) ListTrafficPolicyVersions(id string) ([]*TrafficPolicy, error)
- func (b *InMemoryBackend) ListVPCAssociationAuthorizations(zoneID string) ([]VPCAssociationAuthorization, error)
- func (b *InMemoryBackend) ListVPCAssociations(zoneID string) ([]vpcAssociation, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetDNSRegistrar(dns DNSRegistrar)
- func (b *InMemoryBackend) SetHealthCheckStatus(id, status string) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TestDNSAnswer(zoneID, recordName, recordType string, qctx DNSQueryContext) ([]string, error)
- func (b *InMemoryBackend) UpdateHealthCheck(id string, cfg HealthCheckConfig, expectedVersion *int64) (*HealthCheck, error)
- func (b *InMemoryBackend) UpdateHostedZoneComment(zoneID, comment string) (*HostedZone, error)
- func (b *InMemoryBackend) UpdateTrafficPolicyComment(id string, version int32, comment string) (*TrafficPolicy, error)
- func (b *InMemoryBackend) UpdateTrafficPolicyInstance(id, tpID string, tpVersion int32, ttl int64) (*TrafficPolicyInstance, error)
- type KeySigningKey
- type Provider
- type QueryLoggingConfig
- type RRSetPage
- type ResourceRecord
- type ResourceRecordSet
- type ReusableDelegationSet
- type StorageBackend
- type TrafficPolicy
- type TrafficPolicyInstance
- type TrafficPolicySummary
- type VPCAssociationAuthorization
Constants ¶
This section is empty.
Variables ¶
var ( ErrHostedZoneNotFound = errors.New("NoSuchHostedZone") ErrInvalidInput = errors.New("InvalidInput") ErrInvalidAction = errors.New("InvalidChangeBatch") ErrHealthCheckNotFound = errors.New("NoSuchHealthCheck") ErrKeySigningKeyNotFound = errors.New("NoSuchKeySigningKey") // ErrCidrCollectionNotFound wire code intentionally carries the "Exception" // suffix — that is the literal AWS error code for this shape (unlike most // Route 53 NoSuch* errors), confirmed against aws-sdk-go-v2 route53 model. ErrCidrCollectionNotFound = errors.New("NoSuchCidrCollectionException") ErrQueryLoggingConfigNotFound = errors.New("NoSuchQueryLoggingConfig") ErrDelegationSetNotFound = errors.New("NoSuchDelegationSet") ErrTrafficPolicyNotFound = errors.New("NoSuchTrafficPolicy") ErrTrafficPolicyInstNotFound = errors.New("NoSuchTrafficPolicyInstance") ErrChangeNotFound = errors.New("NoSuchChange") ErrNoSuchGeoLocation = errors.New("NoSuchGeoLocation") ErrQueryLoggingConfigAlreadyExists = errors.New("QueryLoggingConfigAlreadyExists") ErrPublicZoneVPCAssociation = errors.New("PublicZoneVPCAssociation") ErrVPCAssociationAuthorizationNF = errors.New("VPCAssociationAuthorizationNotFound") ErrKeySigningKeyWithActiveStatusNF = errors.New("KeySigningKeyWithActiveStatusNotFound") ErrInvalidARecord = errors.New("invalid A record value") ErrInvalidAAAARecord = errors.New("invalid AAAA record value") ErrInvalidMXRecord = errors.New("invalid MX record value") ErrInvalidSRVRecord = errors.New("invalid SRV record value") ErrInvalidCAARecord = errors.New("invalid CAA record value") ErrInvalidTXTRecord = errors.New("invalid TXT record value") ErrInvalidCNAMERecord = errors.New("invalid CNAME record value") ErrInvalidNSRecord = errors.New("invalid NS record value") ErrInvalidPTRRecord = errors.New("invalid PTR record value") ErrInvalidNAPTRRecord = errors.New("invalid NAPTR record value") ErrInvalidDSRecord = errors.New("invalid DS record value") ErrInvalidSPFRecord = errors.New("invalid SPF record value") ErrTrafficPolicyInUse = errors.New("TrafficPolicyInUse") // ErrInvalidKeySigningKeyStatus is returned when a KSK operation is attempted // while the key is in a status that does not permit it (e.g. deleting an // ACTIVE key). This is the real AWS wire error code — Route 53 has no // "KeySigningKeyNotInactive" error. ErrInvalidKeySigningKeyStatus = errors.New("InvalidKeySigningKeyStatus") ErrTrafficPolicyAlreadyExists = errors.New("TrafficPolicyAlreadyExists") ErrHostedZoneNotEmpty = errors.New("HostedZoneNotEmpty") ErrLastVPCAssociation = errors.New("LastVPCAssociation") // ErrHostedZoneAlreadyExists is returned when CreateHostedZone reuses a // CallerReference already associated with a hosted zone that has different // Name/Comment/PrivateZone values (AWS: HostedZoneAlreadyExists, 409). ErrHostedZoneAlreadyExists = errors.New("HostedZoneAlreadyExists") // ErrHealthCheckAlreadyExists is returned when CreateHealthCheck reuses a // CallerReference already associated with a health check that has a // different configuration (AWS: HealthCheckAlreadyExists, 409). ErrHealthCheckAlreadyExists = errors.New("HealthCheckAlreadyExists") // ErrKeySigningKeyAlreadyExists is returned when CreateKeySigningKey is // called with a name that already exists in the hosted zone (AWS: // KeySigningKeyAlreadyExists, 409). ErrKeySigningKeyAlreadyExists = errors.New("KeySigningKeyAlreadyExists") // ErrVPCAssociationNotFound is returned by DisassociateVPCFromHostedZone // when the given VPC is not associated with the hosted zone (AWS: // VPCAssociationNotFound, 404). ErrVPCAssociationNotFound = errors.New("VPCAssociationNotFound") // ErrTrafficPolicyInstanceAlreadyExists is returned when // CreateTrafficPolicyInstance targets a (hostedZoneID, name) pair that // already has a traffic policy instance (AWS: // TrafficPolicyInstanceAlreadyExists, 409). ErrTrafficPolicyInstanceAlreadyExists = errors.New("TrafficPolicyInstanceAlreadyExists") // ErrCidrCollectionAlreadyExists is returned when CreateCidrCollection is // called with a name that is already in use (AWS: // CidrCollectionAlreadyExistsException, 400). ErrCidrCollectionAlreadyExists = errors.New("CidrCollectionAlreadyExistsException") // ErrHealthCheckVersionMismatch is returned when UpdateHealthCheck is // called with a HealthCheckVersion that does not match the health // check's current version (AWS: HealthCheckVersionMismatch, 409). ErrHealthCheckVersionMismatch = errors.New("HealthCheckVersionMismatch") // ErrCidrCollectionVersionMismatch is returned when ChangeCidrCollection // is called with a CollectionVersion that does not match the // collection's current version (AWS: // CidrCollectionVersionMismatchException, 409). ErrCidrCollectionVersionMismatch = errors.New("CidrCollectionVersionMismatchException") // ErrCidrCollectionInUse is returned when DeleteCidrCollection is called // on a non-empty collection — real AWS requires the collection to be // emptied of locations/blocks before it can be deleted (AWS: // CidrCollectionInUseException, 400). ErrCidrCollectionInUse = errors.New("CidrCollectionInUseException") // ErrDelegationSetInUse is returned when DeleteReusableDelegationSet is // called on a delegation set that is still associated with one or more // hosted zones (AWS: DelegationSetInUse, 400). ErrDelegationSetInUse = errors.New("DelegationSetInUse") // ErrHostedZoneNotFoundForDelegationSet is returned by // CreateReusableDelegationSet when its optional HostedZoneId parameter // names a zone that doesn't exist. AWS uses a distinct wire code here — // "HostedZoneNotFound" — from the "NoSuchHostedZone" code every other // Route 53 hosted-zone-lookup op returns; confirmed against the // CreateReusableDelegationSet API reference's Errors section. ErrHostedZoneNotFoundForDelegationSet = errors.New("HostedZoneNotFound") // ErrDelegationSetAlreadyReusable is returned when // CreateReusableDelegationSet's HostedZoneId parameter names a zone // whose delegation set has already been extracted into a reusable // delegation set (AWS: DelegationSetAlreadyReusable, 400). ErrDelegationSetAlreadyReusable = errors.New("DelegationSetAlreadyReusable") // ErrDelegationSetAlreadyCreated is returned when // CreateReusableDelegationSet is called with a CallerReference that was // already used to create a reusable delegation set (AWS: // DelegationSetAlreadyCreated, 400). ErrDelegationSetAlreadyCreated = errors.New("DelegationSetAlreadyCreated") // ErrInvalidKMSArn is returned by CreateKeySigningKey when // KeyManagementServiceArn is not a well-formed KMS customer managed key // ARN (AWS: InvalidKMSArn, 400). ErrInvalidKMSArn = errors.New("InvalidKMSArn") )
Errors returned by the backend.
var ErrNilAppContext = errors.New("route53: AppContext is nil")
ErrNilAppContext is returned by Init when a nil AppContext is passed.
Functions ¶
This section is empty.
Types ¶
type AlarmIdentifier ¶
AlarmIdentifier identifies a CloudWatch alarm for CLOUDWATCH_METRIC health checks.
type AliasTarget ¶
type AliasTarget struct {
HostedZoneID string `json:"hostedZoneID"`
DNSName string `json:"dnsName"`
EvaluateTargetHealth bool `json:"evaluateTargetHealth"`
}
AliasTarget represents an alias resource record set target.
type Change ¶
type Change struct {
Action ChangeAction
ResourceRecordSet ResourceRecordSet
}
Change represents a single change in a ChangeResourceRecordSets request.
type ChangeAction ¶
type ChangeAction string
ChangeAction is the action type for ChangeResourceRecordSets.
const ( ChangeActionCreate ChangeAction = "CREATE" ChangeActionDelete ChangeAction = "DELETE" ChangeActionUpsert ChangeAction = "UPSERT" )
type ChangeInfo ¶
type ChangeInfo struct {
SubmittedAt time.Time `json:"submittedAt"`
ID string `json:"id"`
Status string `json:"status"`
}
ChangeInfo records the state of a Route 53 change batch.
type CidrCollection ¶
type CidrCollection struct {
Locations map[string][]string `json:"locations"` // locationName → []CIDR
ID string `json:"id"`
Name string `json:"name"`
ARN string `json:"arn"`
Version int64 `json:"version"`
}
CidrCollection represents a Route 53 CIDR collection.
type CidrCollectionChange ¶
type CidrCollectionChange struct {
LocationName string `json:"locationName"`
Action string `json:"action"`
CidrList []string `json:"cidrList"`
}
CidrCollectionChange represents a single change in a ChangeCidrCollection request.
type CidrRoutingConfig ¶
type CidrRoutingConfig struct {
CollectionID string `json:"collectionId"`
LocationName string `json:"locationName"`
}
CidrRoutingConfig ties a record set to a CIDR collection location.
type DNSQueryContext ¶
type DNSQueryContext struct {
ClientRegion string
ContinentCode string
CountryCode string
SubdivisionCode string
ResolverIP string
// contains filtered or unexported fields
}
DNSQueryContext carries the client-side signals Route 53 uses to resolve routing-policy records: the client's AWS region (latency routing), the client's geographic location (geolocation routing) and the resolver IP. randFloat is an injectable source of pseudo-random floats in [0,1) used for weighted selection; when nil a crypto/rand-backed source is used. Tests set it to obtain deterministic weighted draws.
type DNSRegistrar ¶
type DNSRegistrar interface {
RegisterRecord(hostname, recordType string, values []string)
Deregister(hostname string)
}
DNSRegistrar can register and deregister hostnames with an embedded DNS server. RegisterRecord stores the actual record value (IP for A/AAAA, hostname for CNAME/ALIAS).
type FailoverPolicy ¶
type FailoverPolicy string
FailoverPolicy is the failover role for a record set.
const ( // FailoverPrimary is the primary record in failover routing. FailoverPrimary FailoverPolicy = "PRIMARY" // FailoverSecondary is the secondary record in failover routing. FailoverSecondary FailoverPolicy = "SECONDARY" )
type GeoLocation ¶
type GeoLocation struct {
ContinentCode string `json:"continentCode,omitempty"`
CountryCode string `json:"countryCode,omitempty"`
SubdivisionCode string `json:"subdivisionCode,omitempty"`
}
GeoLocation represents a geolocation routing target.
type GeoProximityCoordinates ¶
type GeoProximityCoordinates struct {
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
}
GeoProximityCoordinates holds lat/lon for a GeoProximity endpoint.
type GeoProximityLocation ¶
type GeoProximityLocation struct {
Coordinates *GeoProximityCoordinates `json:"coordinates,omitempty"`
AWSRegion string `json:"awsRegion,omitempty"`
LocalZoneGroup string `json:"localZoneGroup,omitempty"`
Bias int `json:"bias,omitempty"`
}
GeoProximityLocation holds routing configuration for proximity-based routing.
type Handler ¶
type Handler struct {
Backend StorageBackend
}
Handler is the HTTP service handler for Route 53 operations.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Route 53 Handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this Route53 instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts a human-readable operation name from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the zone ID from the request path.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns all mocked Route 53 operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Route 53 requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority for Route 53.
func (*Handler) Reset ¶
func (h *Handler) Reset()
Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a matcher that selects Route 53 requests by path prefix.
type HealthCheck ¶
type HealthCheck struct {
CreatedAt time.Time `json:"createdAt"`
ID string `json:"id"`
CallerReference string `json:"callerReference"`
Status string `json:"status"`
Observations []HealthCheckObservation `json:"observations"`
Config HealthCheckConfig `json:"config"`
// Version is a sequential counter AWS sets to 1 at creation and
// increments by 1 on every UpdateHealthCheck. Wire field
// HealthCheckVersion; UpdateHealthCheck's optional request-side
// HealthCheckVersion is checked against this for optimistic
// concurrency (see ErrHealthCheckVersionMismatch).
Version int64 `json:"version"`
}
HealthCheck represents a Route 53 health check.
type HealthCheckConfig ¶
type HealthCheckConfig struct {
AlarmIdentifier *AlarmIdentifier `json:"alarmIdentifier,omitempty"`
IPAddress string `json:"ipAddress,omitempty"`
FullyQualifiedDomainName string `json:"fullyQualifiedDomainName,omitempty"`
ResourcePath string `json:"resourcePath,omitempty"`
SearchString string `json:"searchString,omitempty"`
InsufficientDataHealthStatus string `json:"insufficientDataHealthStatus,omitempty"`
RoutingControlArn string `json:"routingControlArn,omitempty"`
Type HealthCheckType `json:"type"`
Regions []string `json:"regions,omitempty"`
ChildHealthChecks []string `json:"childHealthChecks,omitempty"`
Port int `json:"port,omitempty"`
RequestInterval int `json:"requestInterval,omitempty"`
FailureThreshold int `json:"failureThreshold,omitempty"`
HealthThreshold int `json:"healthThreshold,omitempty"`
EnableSNI bool `json:"enableSNI,omitempty"`
MeasureLatency bool `json:"measureLatency,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Inverted bool `json:"inverted,omitempty"`
}
HealthCheckConfig holds the configuration for a health check.
type HealthCheckObservation ¶
type HealthCheckObservation struct {
CheckedTime time.Time `json:"checkedTime"`
Region string `json:"region"`
IPAddress string `json:"ipAddress"`
Status string `json:"status"`
}
HealthCheckObservation represents a single observation of a health check.
type HealthCheckType ¶
type HealthCheckType string
HealthCheckType is the type of health check.
const ( HealthCheckTypeHTTP HealthCheckType = "HTTP" HealthCheckTypeHTTPS HealthCheckType = "HTTPS" HealthCheckTypeTCP HealthCheckType = "TCP" HealthCheckTypeCalculated HealthCheckType = "CALCULATED" HealthCheckTypeCloudWatchMetric HealthCheckType = "CLOUDWATCH_METRIC" HealthCheckTypeRecoveryControl HealthCheckType = "RECOVERY_CONTROL" )
type HostedZone ¶
type HostedZone struct {
CreatedAt time.Time `json:"createdAt"`
Name string `json:"name"`
ID string `json:"id"`
CallerReference string `json:"callerReference"`
Comment string `json:"comment"`
// DelegationSetID is the ID of the reusable delegation set this zone
// was created with, or "" if the zone uses a system-assigned (non
// reusable) delegation set. Not part of the wire "HostedZone" element
// itself — real AWS only surfaces it via the separate DelegationSet
// element on CreateHostedZone/GetHostedZone responses.
DelegationSetID string `json:"delegationSetId,omitempty"`
// NameServers are the authoritative name servers for this zone, fixed
// at creation time: either the reusable delegation set's servers (when
// DelegationSetID is set) or the default pair otherwise.
NameServers []string `json:"nameServers,omitempty"`
ResourceRecordSetCount int `json:"resourceRecordSetCount"`
PrivateZone bool `json:"privateZone"`
// DelegationSetSourceUsed marks that this zone's own name servers have
// already been extracted into a reusable delegation set via
// CreateReusableDelegationSet's HostedZoneId parameter. Backend-internal
// bookkeeping only — not part of the wire "HostedZone" element — mirrors
// the real AWS rule that a zone's delegation set can only be marked
// reusable once; a second attempt returns DelegationSetAlreadyReusable.
DelegationSetSourceUsed bool `json:"delegationSetSourceUsed,omitempty"`
}
HostedZone represents a Route 53 hosted zone.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend stores Route 53 state in memory.
Most resource collections are *store.Table[T], registered once on registry at construction time (see store_setup.go); registry.ResetAll() then collapses their runtime reset to one call in Reset below. A handful of fields are deliberately left as plain maps -- see the doc comment atop store_setup.go for the full list and why.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates a new InMemoryBackend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the AWS account ID for this backend.
func (*InMemoryBackend) ActivateKeySigningKey ¶
func (b *InMemoryBackend) ActivateKeySigningKey(hostedZoneID, name string) (*KeySigningKey, error)
ActivateKeySigningKey activates an existing key signing key.
func (*InMemoryBackend) AddHealthCheckInternal ¶
func (b *InMemoryBackend) AddHealthCheckInternal(hc HealthCheck)
AddHealthCheckInternal adds a health check directly into the backend for testing.
func (*InMemoryBackend) AddKeySigningKeyInternal ¶
func (b *InMemoryBackend) AddKeySigningKeyInternal(ksk KeySigningKey)
AddKeySigningKeyInternal adds a KSK directly into the backend for testing.
func (*InMemoryBackend) AddTrafficPolicyInternal ¶
func (b *InMemoryBackend) AddTrafficPolicyInternal(tp TrafficPolicy)
AddTrafficPolicyInternal adds a traffic policy directly into the backend for testing.
func (*InMemoryBackend) AddZoneInternal ¶
func (b *InMemoryBackend) AddZoneInternal(hz HostedZone)
AddZoneInternal adds a hosted zone directly into the backend for testing.
func (*InMemoryBackend) AssociateVPCWithHostedZone ¶
func (b *InMemoryBackend) AssociateVPCWithHostedZone(zoneID, vpcID, vpcRegion string) error
AssociateVPCWithHostedZone associates a VPC with a private hosted zone. Returns ErrPublicZoneVPCAssociation when called on a public zone.
Re-associating a VPC that is already associated with this same zone is a no-op success, not an error: AWS's documented AssociateVPCWithHostedZone error list has no "duplicate association" error, and its one association-conflict error (ConflictingDomainExists) is explicitly scoped to "the VPC is already associated with *another* hosted zone that has the same name" — which rules it out for the same-VPC-same-zone case handled here.
func (*InMemoryBackend) ChangeCidrCollection ¶
func (b *InMemoryBackend) ChangeCidrCollection( collectionID string, changes []CidrCollectionChange, expectedVersion *int64, ) (*CidrCollection, error)
ChangeCidrCollection applies PUT/DELETE_IF_EXISTS changes to a CIDR collection's locations. expectedVersion is the caller-supplied CollectionVersion, or nil when the request omitted it (the field is optional on the wire). When present, it must match the collection's current Version or the change is rejected with ErrCidrCollectionVersionMismatch — AWS's optimistic-concurrency guard against overwriting an intervening update.
func (*InMemoryBackend) ChangeResourceRecordSets ¶
func (b *InMemoryBackend) ChangeResourceRecordSets( zoneID string, changes []Change, ) (string, error)
ChangeResourceRecordSets applies a batch of record set changes atomically. All changes are validated before any mutation is applied.
func (*InMemoryBackend) ChangeTagsForResource ¶
func (*InMemoryBackend) CountAssociatedVPCs ¶
func (b *InMemoryBackend) CountAssociatedVPCs(zoneID string) (int, error)
CountAssociatedVPCs returns the number of VPCs associated with the given hosted zone. It returns ErrHostedZoneNotFound if the zone does not exist.
func (*InMemoryBackend) CountResourceRecordSets ¶
func (b *InMemoryBackend) CountResourceRecordSets(zoneID string) (int, error)
CountResourceRecordSets returns the number of resource record sets in the given hosted zone. It returns ErrHostedZoneNotFound if the zone does not exist.
func (*InMemoryBackend) CountZonesByReusableDelegationSet ¶
func (b *InMemoryBackend) CountZonesByReusableDelegationSet(id string) (int, error)
CountZonesByReusableDelegationSet returns the number of hosted zones that use the given reusable delegation set. It returns ErrDelegationSetNotFound if the delegation set does not exist.
func (*InMemoryBackend) CreateCidrCollection ¶
func (b *InMemoryBackend) CreateCidrCollection( name, _ string, ) (*CidrCollection, error)
CreateCidrCollection creates a new CIDR collection.
func (*InMemoryBackend) CreateHealthCheck ¶
func (b *InMemoryBackend) CreateHealthCheck( callerRef string, cfg HealthCheckConfig, ) (*HealthCheck, error)
CreateHealthCheck creates a new health check.
func (*InMemoryBackend) CreateHostedZone ¶
func (b *InMemoryBackend) CreateHostedZone( name, callerRef, comment string, private bool, delegationSetID string, ) (*HostedZone, error)
CreateHostedZone creates a new hosted zone. When delegationSetID is non-empty, the zone is linked to that reusable delegation set (which must already exist, see ErrDelegationSetNotFound) and inherits its name servers; otherwise the zone gets the default system-assigned name servers.
func (*InMemoryBackend) CreateKeySigningKey ¶
func (b *InMemoryBackend) CreateKeySigningKey( hostedZoneID, _, name, kmsArn, status string, ) (*KeySigningKey, error)
CreateKeySigningKey creates a new key signing key for a hosted zone.
func (*InMemoryBackend) CreateQueryLoggingConfig ¶
func (b *InMemoryBackend) CreateQueryLoggingConfig( hostedZoneID, logGroupArn string, ) (*QueryLoggingConfig, error)
CreateQueryLoggingConfig creates a new query logging configuration. AWS allows at most one config per hosted zone.
func (*InMemoryBackend) CreateReusableDelegationSet ¶
func (b *InMemoryBackend) CreateReusableDelegationSet( callerRef, hostedZoneID string, ) (*ReusableDelegationSet, error)
CreateReusableDelegationSet creates a new reusable delegation set.
When hostedZoneID is non-empty, this is real AWS's "mark an existing hosted zone's delegation set as reusable" mode (see the migration steps documented on CreateReusableDelegationSet): the new set reuses that zone's own current name servers instead of the default pair. The referenced zone must exist (ErrHostedZoneNotFoundForDelegationSet — a distinct wire code from the NoSuchHostedZone every other hosted-zone lookup returns), must be a public zone (a reusable delegation set can't be associated with a private hosted zone), and must not have already had its delegation set extracted this way (ErrDelegationSetAlreadyReusable).
Reusing a CallerReference that already identifies a reusable delegation set always fails with ErrDelegationSetAlreadyCreated — unlike CreateHostedZone/CreateHealthCheck, real AWS does not treat this as an idempotent retry for this operation.
func (*InMemoryBackend) CreateTrafficPolicy ¶
func (b *InMemoryBackend) CreateTrafficPolicy( name, document, comment string, ) (*TrafficPolicy, error)
CreateTrafficPolicy creates a new traffic policy.
func (*InMemoryBackend) CreateTrafficPolicyInstance ¶
func (b *InMemoryBackend) CreateTrafficPolicyInstance( hostedZoneID, name, tpID string, tpVersion int32, ttl int64, ) (*TrafficPolicyInstance, error)
CreateTrafficPolicyInstance creates a new traffic policy instance.
func (*InMemoryBackend) CreateTrafficPolicyVersion ¶
func (b *InMemoryBackend) CreateTrafficPolicyVersion( id, document, comment string, ) (*TrafficPolicy, error)
CreateTrafficPolicyVersion creates a new version of an existing traffic policy.
func (*InMemoryBackend) CreateVPCAssociationAuthorization ¶
func (b *InMemoryBackend) CreateVPCAssociationAuthorization( zoneID, vpcID, vpcRegion string, ) (*VPCAssociationAuthorization, error)
CreateVPCAssociationAuthorization authorizes a VPC to be associated with a hosted zone from another AWS account.
func (*InMemoryBackend) DeactivateKeySigningKey ¶
func (b *InMemoryBackend) DeactivateKeySigningKey( hostedZoneID, name string, ) (*KeySigningKey, error)
DeactivateKeySigningKey deactivates an existing key signing key.
func (*InMemoryBackend) DeleteCidrCollection ¶
func (b *InMemoryBackend) DeleteCidrCollection(id string) error
DeleteCidrCollection deletes a CIDR collection. DeleteCidrCollection deletes a CIDR collection. Real AWS requires the collection to be empty (no locations/CIDR blocks) before it can be deleted — see ErrCidrCollectionInUse.
func (*InMemoryBackend) DeleteHealthCheck ¶
func (b *InMemoryBackend) DeleteHealthCheck(id string) error
DeleteHealthCheck removes a health check.
func (*InMemoryBackend) DeleteHostedZone ¶
func (b *InMemoryBackend) DeleteHostedZone(zoneID string) error
DeleteHostedZone removes a hosted zone and all its record sets.
func (*InMemoryBackend) DeleteKeySigningKey ¶
func (b *InMemoryBackend) DeleteKeySigningKey(hostedZoneID, name string) error
DeleteKeySigningKey deletes a key signing key. The KSK must be INACTIVE; deleting an ACTIVE KSK returns ErrInvalidKeySigningKeyStatus (AWS: InvalidKeySigningKeyStatus).
func (*InMemoryBackend) DeleteQueryLoggingConfig ¶
func (b *InMemoryBackend) DeleteQueryLoggingConfig(id string) error
DeleteQueryLoggingConfig deletes a query logging config.
func (*InMemoryBackend) DeleteReusableDelegationSet ¶
func (b *InMemoryBackend) DeleteReusableDelegationSet(id string) error
DeleteReusableDelegationSet deletes a reusable delegation set. It returns ErrDelegationSetInUse if any hosted zone is still linked to it — real AWS requires all zones created with the set to be deleted first.
func (*InMemoryBackend) DeleteTrafficPolicy ¶
func (b *InMemoryBackend) DeleteTrafficPolicy(id string, version int32) error
DeleteTrafficPolicy deletes a specific version of a traffic policy. If it is the last version, the entire policy is removed.
func (*InMemoryBackend) DeleteTrafficPolicyInstance ¶
func (b *InMemoryBackend) DeleteTrafficPolicyInstance(id string) error
DeleteTrafficPolicyInstance deletes a traffic policy instance.
func (*InMemoryBackend) DeleteVPCAssociationAuthorization ¶
func (b *InMemoryBackend) DeleteVPCAssociationAuthorization(zoneID, vpcID string) error
DeleteVPCAssociationAuthorization removes a VPC association authorization.
func (*InMemoryBackend) DisableHostedZoneDNSSEC ¶
func (b *InMemoryBackend) DisableHostedZoneDNSSEC(zoneID string) error
DisableHostedZoneDNSSEC disables DNSSEC for a hosted zone.
func (*InMemoryBackend) DisassociateVPCFromHostedZone ¶
func (b *InMemoryBackend) DisassociateVPCFromHostedZone(zoneID, vpcID string) error
DisassociateVPCFromHostedZone removes a VPC association from a private hosted zone.
func (*InMemoryBackend) EnableHostedZoneDNSSEC ¶
func (b *InMemoryBackend) EnableHostedZoneDNSSEC(zoneID string) error
EnableHostedZoneDNSSEC enables DNSSEC for a hosted zone. Requires at least one ACTIVE KSK; returns ErrKeySigningKeyWithActiveStatusNF otherwise.
func (*InMemoryBackend) GetChange ¶
func (b *InMemoryBackend) GetChange(changeID string) (*ChangeInfo, error)
GetChange returns the ChangeInfo for a given change ID.
func (*InMemoryBackend) GetDNSSEC ¶
func (b *InMemoryBackend) GetDNSSEC(zoneID string) (bool, []KeySigningKey, error)
GetDNSSEC returns the DNSSEC status and key signing keys for a hosted zone.
func (*InMemoryBackend) GetHealthCheck ¶
func (b *InMemoryBackend) GetHealthCheck(id string) (*HealthCheck, error)
GetHealthCheck returns a single health check.
func (*InMemoryBackend) GetHealthCheckCount ¶
func (b *InMemoryBackend) GetHealthCheckCount() int
GetHealthCheckCount returns the total number of health checks.
func (*InMemoryBackend) GetHealthCheckStatus ¶
func (b *InMemoryBackend) GetHealthCheckStatus(id string) (string, error)
GetHealthCheckStatus returns the mocked health status for a health check.
func (*InMemoryBackend) GetHostedZone ¶
func (b *InMemoryBackend) GetHostedZone(zoneID string) (*HostedZone, error)
GetHostedZone returns a single hosted zone.
func (*InMemoryBackend) GetHostedZoneCount ¶
func (b *InMemoryBackend) GetHostedZoneCount() int
GetHostedZoneCount returns the total number of hosted zones.
func (*InMemoryBackend) GetQueryLoggingConfig ¶
func (b *InMemoryBackend) GetQueryLoggingConfig(id string) (*QueryLoggingConfig, error)
GetQueryLoggingConfig returns a query logging config by ID.
func (*InMemoryBackend) GetReusableDelegationSet ¶
func (b *InMemoryBackend) GetReusableDelegationSet(id string) (*ReusableDelegationSet, error)
GetReusableDelegationSet returns a reusable delegation set by ID.
func (*InMemoryBackend) GetTrafficPolicy ¶
func (b *InMemoryBackend) GetTrafficPolicy(id string, version int32) (*TrafficPolicy, error)
GetTrafficPolicy returns a specific version of a traffic policy.
func (*InMemoryBackend) GetTrafficPolicyInstance ¶
func (b *InMemoryBackend) GetTrafficPolicyInstance(id string) (*TrafficPolicyInstance, error)
GetTrafficPolicyInstance returns a traffic policy instance by ID.
func (*InMemoryBackend) ListCidrBlocks ¶
func (b *InMemoryBackend) ListCidrBlocks(collectionID, locationName string) ([]string, error)
ListCidrBlocks returns all CIDR blocks for a given location in a collection.
func (*InMemoryBackend) ListCidrCollections ¶
func (b *InMemoryBackend) ListCidrCollections() ([]*CidrCollection, error)
ListCidrCollections returns all CIDR collections.
func (*InMemoryBackend) ListCidrLocations ¶
func (b *InMemoryBackend) ListCidrLocations(collectionID string) ([]string, error)
ListCidrLocations returns all location names in a CIDR collection.
func (*InMemoryBackend) ListHealthChecks ¶
func (b *InMemoryBackend) ListHealthChecks( marker string, maxItems int, ) (page.Page[HealthCheck], error)
ListHealthChecks returns all health checks.
func (*InMemoryBackend) ListHostedZones ¶
func (b *InMemoryBackend) ListHostedZones( marker string, maxItems int, ) (page.Page[HostedZone], error)
ListHostedZones returns hosted zones sorted by name, with optional pagination.
func (*InMemoryBackend) ListHostedZonesByName ¶
func (b *InMemoryBackend) ListHostedZonesByName( dnsName, zoneID string, maxItems int, ) ([]HostedZone, string, string, error)
ListHostedZonesByName returns hosted zones sorted by name, paginating by DNSName and zoneID.
func (*InMemoryBackend) ListHostedZonesByVPC ¶
func (b *InMemoryBackend) ListHostedZonesByVPC(vpcID, vpcRegion string) ([]HostedZone, error)
ListHostedZonesByVPC returns all private hosted zones that have a VPC association with the given VPC.
func (*InMemoryBackend) ListQueryLoggingConfigs ¶
func (b *InMemoryBackend) ListQueryLoggingConfigs( hostedZoneID string, ) ([]*QueryLoggingConfig, error)
ListQueryLoggingConfigs returns all query logging configs, optionally filtered by zone.
func (*InMemoryBackend) ListResourceRecordSets ¶
func (b *InMemoryBackend) ListResourceRecordSets( zoneID, startName, startType, startIdentifier string, maxItems int, ) (RRSetPage, error)
ListResourceRecordSets returns a page of the hosted zone's record sets, ordered by Name/Type/SetIdentifier, starting from an optional pagination cursor.
func (*InMemoryBackend) ListReusableDelegationSets ¶
func (b *InMemoryBackend) ListReusableDelegationSets() ([]*ReusableDelegationSet, error)
ListReusableDelegationSets returns all reusable delegation sets.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceType, resourceID string) (map[string]string, error)
ListTagsForResource returns the tags for a single hosted zone or health check.
func (*InMemoryBackend) ListTagsForResources ¶
func (b *InMemoryBackend) ListTagsForResources( resourceType string, resourceIDs []string, ) (map[string]map[string]string, error)
ListTagsForResources returns the tags for a batch of same-type resources. If any resourceID does not exist, the whole call fails (matching AWS, which validates the entire ResourceIds list before returning tags).
func (*InMemoryBackend) ListTrafficPolicies ¶
func (b *InMemoryBackend) ListTrafficPolicies() ([]*TrafficPolicySummary, error)
ListTrafficPolicies returns the latest version of each traffic policy with its version count.
func (*InMemoryBackend) ListTrafficPolicyInstances ¶
func (b *InMemoryBackend) ListTrafficPolicyInstances() ([]*TrafficPolicyInstance, error)
ListTrafficPolicyInstances returns all traffic policy instances.
func (*InMemoryBackend) ListTrafficPolicyInstancesByHostedZone ¶
func (b *InMemoryBackend) ListTrafficPolicyInstancesByHostedZone( hostedZoneID string, ) ([]*TrafficPolicyInstance, error)
ListTrafficPolicyInstancesByHostedZone filters instances by hosted zone ID.
func (*InMemoryBackend) ListTrafficPolicyInstancesByPolicy ¶
func (b *InMemoryBackend) ListTrafficPolicyInstancesByPolicy( tpID string, tpVersion int32, ) ([]*TrafficPolicyInstance, error)
ListTrafficPolicyInstancesByPolicy filters instances by traffic policy ID and version.
func (*InMemoryBackend) ListTrafficPolicyVersions ¶
func (b *InMemoryBackend) ListTrafficPolicyVersions(id string) ([]*TrafficPolicy, error)
ListTrafficPolicyVersions returns all versions of a traffic policy.
func (*InMemoryBackend) ListVPCAssociationAuthorizations ¶
func (b *InMemoryBackend) ListVPCAssociationAuthorizations( zoneID string, ) ([]VPCAssociationAuthorization, error)
ListVPCAssociationAuthorizations returns all VPC association authorizations for a hosted zone.
func (*InMemoryBackend) ListVPCAssociations ¶
func (b *InMemoryBackend) ListVPCAssociations(zoneID string) ([]vpcAssociation, error)
ListVPCAssociations returns all VPCs associated with a hosted zone.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the AWS region for this backend.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable. The DNS registrar is not restored — it must be re-wired by the caller after restore.
func (*InMemoryBackend) SetDNSRegistrar ¶
func (b *InMemoryBackend) SetDNSRegistrar(dns DNSRegistrar)
SetDNSRegistrar wires a DNS server so A/CNAME records are auto-registered.
func (*InMemoryBackend) SetHealthCheckStatus ¶
func (b *InMemoryBackend) SetHealthCheckStatus(id, status string) error
SetHealthCheckStatus overrides the mocked health status for a health check. This allows tests to simulate failover scenarios.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) TestDNSAnswer ¶
func (b *InMemoryBackend) TestDNSAnswer( zoneID, recordName, recordType string, qctx DNSQueryContext, ) ([]string, error)
TestDNSAnswer looks up a record in the hosted zone and returns the values the resolver would answer with, applying routing policy (weighted, latency, geolocation, failover, multivalue), health-check status and alias recursion. The DNSQueryContext supplies client-side signals (region, geo, weighted RNG).
func (*InMemoryBackend) UpdateHealthCheck ¶
func (b *InMemoryBackend) UpdateHealthCheck( id string, cfg HealthCheckConfig, expectedVersion *int64, ) (*HealthCheck, error)
UpdateHealthCheck updates configuration fields of an existing health check. expectedVersion is the caller-supplied HealthCheckVersion, or nil when the request omitted it (the field is optional on the wire). When present, it must match the health check's current Version or the update is rejected with ErrHealthCheckVersionMismatch — this is AWS's optimistic-concurrency guard against overwriting an intervening update. Version is incremented by 1 on every successful update, matching real AWS's documented behavior.
func (*InMemoryBackend) UpdateHostedZoneComment ¶
func (b *InMemoryBackend) UpdateHostedZoneComment(zoneID, comment string) (*HostedZone, error)
UpdateHostedZoneComment updates the comment on an existing hosted zone.
func (*InMemoryBackend) UpdateTrafficPolicyComment ¶
func (b *InMemoryBackend) UpdateTrafficPolicyComment( id string, version int32, comment string, ) (*TrafficPolicy, error)
UpdateTrafficPolicyComment updates the comment on a specific version of a traffic policy.
func (*InMemoryBackend) UpdateTrafficPolicyInstance ¶
func (b *InMemoryBackend) UpdateTrafficPolicyInstance( id, tpID string, tpVersion int32, ttl int64, ) (*TrafficPolicyInstance, error)
UpdateTrafficPolicyInstance updates the TTL of a traffic policy instance.
type KeySigningKey ¶
type KeySigningKey struct {
CreatedAt time.Time `json:"createdAt"`
HostedZoneID string `json:"hostedZoneId"`
Name string `json:"name"`
KeyManagementServiceArn string `json:"keyManagementServiceArn"`
Status string `json:"status"`
SigningAlgorithmMnemonic string `json:"signingAlgorithmMnemonic"`
DigestAlgorithmMnemonic string `json:"digestAlgorithmMnemonic"`
PublicKey string `json:"publicKey"`
DSRecord string `json:"dsRecord"`
DigestValue string `json:"digestValue"`
Flag int `json:"flag"`
SigningAlgorithmType int `json:"signingAlgorithmType"`
DigestAlgorithmType int `json:"digestAlgorithmType"`
KeyTag int `json:"keyTag"`
}
KeySigningKey represents a Route 53 key signing key for DNSSEC.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Route 53 service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Route 53 service backend and handler.
type QueryLoggingConfig ¶
type QueryLoggingConfig struct {
CreatedAt time.Time `json:"createdAt"`
ID string `json:"id"`
HostedZoneID string `json:"hostedZoneId"`
CloudWatchLogsLogGroupArn string `json:"cloudWatchLogsLogGroupArn"`
}
QueryLoggingConfig represents a Route 53 query logging configuration.
type RRSetPage ¶
type RRSetPage struct {
NextName string
NextType string
NextIdentifier string
Records []ResourceRecordSet
IsTruncated bool
}
RRSetPage is a page of ResourceRecordSets with pagination cursors.
type ResourceRecord ¶
type ResourceRecord struct {
Value string `json:"value"`
}
ResourceRecord holds a single DNS resource record value.
type ResourceRecordSet ¶
type ResourceRecordSet struct {
AliasTarget *AliasTarget `json:"aliasTarget,omitempty"`
GeoLocation *GeoLocation `json:"geoLocation,omitempty"`
GeoProximityLocation *GeoProximityLocation `json:"geoProximityLocation,omitempty"`
CidrRoutingConfig *CidrRoutingConfig `json:"cidrRoutingConfig,omitempty"`
Weight *int64 `json:"weight,omitempty"`
SetIdentifier string `json:"setIdentifier,omitempty"`
Type string `json:"type"`
Failover FailoverPolicy `json:"failover,omitempty"`
Region string `json:"region,omitempty"`
HealthCheckID string `json:"healthCheckId,omitempty"`
Name string `json:"name"`
Records []ResourceRecord `json:"records"`
TTL int64 `json:"ttl"`
MultiValueAnswer bool `json:"multiValueAnswer,omitempty"`
}
ResourceRecordSet represents a DNS resource record set.
type ReusableDelegationSet ¶
type ReusableDelegationSet struct {
CreatedAt time.Time `json:"createdAt"`
ID string `json:"id"`
CallerReference string `json:"callerReference"`
NameServers []string `json:"nameServers"`
}
ReusableDelegationSet represents a Route 53 reusable delegation set.
type StorageBackend ¶
type StorageBackend interface {
// Hosted zone operations
CreateHostedZone(name, callerRef, comment string, private bool, delegationSetID string) (*HostedZone, error)
DeleteHostedZone(zoneID string) error
GetHostedZone(zoneID string) (*HostedZone, error)
ListHostedZones(marker string, maxItems int) (page.Page[HostedZone], error)
ListHostedZonesByName(dnsName, zoneID string, maxItems int) ([]HostedZone, string, string, error)
GetHostedZoneCount() int
UpdateHostedZoneComment(zoneID, comment string) (*HostedZone, error)
// Record set operations
ChangeResourceRecordSets(zoneID string, changes []Change) (string, error)
ListResourceRecordSets(zoneID, startName, startType, startIdentifier string, maxItems int) (RRSetPage, error)
CountResourceRecordSets(zoneID string) (int, error)
GetChange(changeID string) (*ChangeInfo, error)
// Health check operations
CreateHealthCheck(callerRef string, cfg HealthCheckConfig) (*HealthCheck, error)
GetHealthCheck(id string) (*HealthCheck, error)
ListHealthChecks(marker string, maxItems int) (page.Page[HealthCheck], error)
GetHealthCheckCount() int
DeleteHealthCheck(id string) error
UpdateHealthCheck(id string, cfg HealthCheckConfig, expectedVersion *int64) (*HealthCheck, error)
GetHealthCheckStatus(id string) (string, error)
SetHealthCheckStatus(id, status string) error
// Key signing key operations
CreateKeySigningKey(hostedZoneID, callerRef, name, kmsArn, status string) (*KeySigningKey, error)
ActivateKeySigningKey(hostedZoneID, name string) (*KeySigningKey, error)
DeactivateKeySigningKey(hostedZoneID, name string) (*KeySigningKey, error)
DeleteKeySigningKey(hostedZoneID, name string) error
// DNSSEC operations
EnableHostedZoneDNSSEC(zoneID string) error
DisableHostedZoneDNSSEC(zoneID string) error
GetDNSSEC(zoneID string) (bool, []KeySigningKey, error)
// VPC association operations
AssociateVPCWithHostedZone(zoneID, vpcID, vpcRegion string) error
DisassociateVPCFromHostedZone(zoneID, vpcID string) error
ListVPCAssociations(zoneID string) ([]vpcAssociation, error)
ListHostedZonesByVPC(vpcID, vpcRegion string) ([]HostedZone, error)
CreateVPCAssociationAuthorization(zoneID, vpcID, vpcRegion string) (*VPCAssociationAuthorization, error)
DeleteVPCAssociationAuthorization(zoneID, vpcID string) error
ListVPCAssociationAuthorizations(zoneID string) ([]VPCAssociationAuthorization, error)
CountAssociatedVPCs(zoneID string) (int, error)
// CIDR collection operations
CreateCidrCollection(name, callerRef string) (*CidrCollection, error)
ChangeCidrCollection(
collectionID string,
changes []CidrCollectionChange,
expectedVersion *int64,
) (*CidrCollection, error)
DeleteCidrCollection(id string) error
ListCidrCollections() ([]*CidrCollection, error)
ListCidrLocations(collectionID string) ([]string, error)
ListCidrBlocks(collectionID, locationName string) ([]string, error)
// Query logging operations
CreateQueryLoggingConfig(hostedZoneID, logGroupArn string) (*QueryLoggingConfig, error)
GetQueryLoggingConfig(id string) (*QueryLoggingConfig, error)
DeleteQueryLoggingConfig(id string) error
ListQueryLoggingConfigs(hostedZoneID string) ([]*QueryLoggingConfig, error)
// Delegation set operations
CreateReusableDelegationSet(callerRef, hostedZoneID string) (*ReusableDelegationSet, error)
GetReusableDelegationSet(id string) (*ReusableDelegationSet, error)
DeleteReusableDelegationSet(id string) error
ListReusableDelegationSets() ([]*ReusableDelegationSet, error)
CountZonesByReusableDelegationSet(id string) (int, error)
// DNS query simulation
TestDNSAnswer(zoneID, recordName, recordType string, qctx DNSQueryContext) ([]string, error)
// Traffic policy operations
CreateTrafficPolicy(name, document, comment string) (*TrafficPolicy, error)
CreateTrafficPolicyVersion(id, document, comment string) (*TrafficPolicy, error)
CreateTrafficPolicyInstance(
hostedZoneID, name, tpID string,
tpVersion int32,
ttl int64,
) (*TrafficPolicyInstance, error)
UpdateTrafficPolicyInstance(id, tpID string, tpVersion int32, ttl int64) (*TrafficPolicyInstance, error)
UpdateTrafficPolicyComment(id string, version int32, comment string) (*TrafficPolicy, error)
DeleteTrafficPolicy(id string, version int32) error
GetTrafficPolicy(id string, version int32) (*TrafficPolicy, error)
DeleteTrafficPolicyInstance(id string) error
GetTrafficPolicyInstance(id string) (*TrafficPolicyInstance, error)
ListTrafficPolicies() ([]*TrafficPolicySummary, error)
ListTrafficPolicyVersions(id string) ([]*TrafficPolicy, error)
ListTrafficPolicyInstances() ([]*TrafficPolicyInstance, error)
ListTrafficPolicyInstancesByHostedZone(hostedZoneID string) ([]*TrafficPolicyInstance, error)
ListTrafficPolicyInstancesByPolicy(tpID string, tpVersion int32) ([]*TrafficPolicyInstance, error)
// Tags operations. resourceType is the AWS TagResourceType wire value
// ("hostedzone" or "healthcheck"); it is used to validate that the
// resource actually exists (and to pick the right NoSuch* error) before
// reading or mutating tags.
ListTagsForResource(resourceType, resourceID string) (map[string]string, error)
ListTagsForResources(resourceType string, resourceIDs []string) (map[string]map[string]string, error)
ChangeTagsForResource(resourceType, resourceID string, addTags map[string]string, removeKeys []string) error
// Lifecycle
Reset()
Region() string
AccountID() string
Snapshot(ctx context.Context) []byte
Restore(ctx context.Context, data []byte) error
}
StorageBackend defines the interface for Route 53 backend implementations. All mutating methods must be safe for concurrent use.
type TrafficPolicy ¶
type TrafficPolicy struct {
ID string `json:"id"`
Name string `json:"name"`
Document string `json:"document"`
Comment string `json:"comment,omitempty"`
Type string `json:"type"`
Version int32 `json:"version"`
}
TrafficPolicy represents a Route 53 traffic policy.
type TrafficPolicyInstance ¶
type TrafficPolicyInstance struct {
ID string `json:"id"`
HostedZoneID string `json:"hostedZoneId"`
Name string `json:"name"`
TrafficPolicyID string `json:"trafficPolicyId"`
TrafficPolicyType string `json:"trafficPolicyType"`
State string `json:"state"`
TTL int64 `json:"ttl"`
TrafficPolicyVersion int32 `json:"trafficPolicyVersion"`
}
TrafficPolicyInstance represents a Route 53 traffic policy instance.
type TrafficPolicySummary ¶
type TrafficPolicySummary struct {
TrafficPolicy
VersionCount int32
}
TrafficPolicySummary is returned by ListTrafficPolicies and includes the version count.
type VPCAssociationAuthorization ¶
type VPCAssociationAuthorization struct {
VPCID string `json:"vpcId"`
VPCRegion string `json:"vpcRegion"`
}
VPCAssociationAuthorization records an authorized cross-account VPC association.
Source Files
¶
- cidr_collections.go
- dnssec.go
- errors.go
- handler.go
- handler_cidr_collections.go
- handler_dnssec.go
- handler_health_checks.go
- handler_hosted_zones.go
- handler_key_signing_keys.go
- handler_query_logging.go
- handler_record_sets.go
- handler_reusable_delegation_sets.go
- handler_tags.go
- handler_traffic_policies.go
- handler_traffic_policy_instances.go
- handler_vpc_associations.go
- health_checks.go
- hosted_zones.go
- interfaces.go
- key_signing_keys.go
- models.go
- persistence.go
- provider.go
- query_logging.go
- record_sets.go
- reusable_delegation_sets.go
- routing.go
- store.go
- store_setup.go
- tags.go
- traffic_policies.go
- traffic_policy_instances.go
- vpc_associations.go