* feat(route53resolver): AWS-managed DNS Firewall domain lists
New JSON 1.1 service exposing ListFirewallDomainLists with the four
AWS-managed domain lists, deterministic ids stable across restarts.
LZA's NetworkPrepStack Custom::ResolverManagedDomainList Lambda resolves
managed list ids by name and previously failed with UnknownOperation.
* feat(route53resolver): full-parity build-out (16 ops)
Adds firewall domain list CRUD, resolver endpoint CRUD, resolver rule
CRUD, and rule-association management, backed by four new
StorageBackend stores. The pre-existing deterministic AWS-managed
domain list logic (AWS_MANAGED_DOMAIN_LIST_NAMES, managedList(),
FirewallDomainList) is untouched -- LZA's bootstrap Lambda depends on
those ids being stable across calls.
Also fixes the JSON-1.1 dispatch case in AwsJson11Controller to pass
the account id through to the handler, matching every other service's
dispatch signature (route53resolver was the one holdout still calling
handle() with the old 3-arg signature).
* fix(config): declare route53resolver enabled toggle in both application.yml files
Upstream's ServiceConfigYamlCoverageTest requires every service config with an
enabled() toggle to declare it explicitly in both files; this branch predates
that test and fails it without the declaration.
* docs(route53resolver): register the generated action table
* fix(route53resolver): declare storageKey and storageMode on the service descriptor
The service persists four stores through StorageFactory, but its catalog
descriptor left storageKey and storageMode null, so it was invisible to
PersistentPathValidator's boot check and to per-service storage config
resolution. Mirror the organizations descriptor.
* fix(route53resolver): make creates idempotent on CreatorRequestId
CreateFirewallDomainList, CreateResolverEndpoint and CreateResolverRule
allocated a new resource on every call, so an LZA/CloudFormation retry of
the same CreatorRequestId left duplicates behind. Real AWS returns the
resource the token originally created. Dedupe per store, after the
operation's own validation so a replayed token cannot excuse a malformed
body; a blank or absent token still allocates.
* fix(route53resolver): give outbound resolver endpoints rslvr-out ids
Every CreateResolverEndpoint allocated an inbound-style rslvr-in- id
regardless of Direction, so an outbound endpoint carried an id AWS would
never issue. Key the prefix off Direction (INBOUND/INBOUND_DELEGATION ->
rslvr-in, OUTBOUND -> rslvr-out) and reject values outside the
ResolverEndpointDirection enum instead of silently defaulting to inbound.
* test(route53resolver): assert managed domain lists by name, not by count
ListFirewallDomainLists returns the four managed lists plus whatever
custom lists other tests in the run have created, so size()==4 and the
[0] index extraction were both order-dependent. Assert the four managed
names are present and pick the id by name. Also drop the call-site counts
from the 404-convention comment, which would go stale on any refactor.
* docs(route53resolver): correct the scoping limitation
The limitation claimed resources are visible regardless of the caller's
account. They are not: all four stores are created through StorageFactory,
which wraps every backend in AccountAwareStorageBackend, so keys are
prefixed with the calling credential's account id and both scan() and
keys() filter on that prefix. Region and VPC are what go unenforced, and
the AWS-managed lists are region-derived and globally visible by design.
* fix(route53resolver): validate Direction before the CreatorRequestId replay check
endpointIdPrefix ran only on the allocation path, so replaying a known
CreatorRequestId with an unrecognised Direction returned 200 and the
original endpoint instead of InvalidParametersException. Bind the prefix
right after the Direction is read, so every request is validated whether
or not it turns out to be a replay.
* fix(route53resolver): enforce the RuleType and ResolverEndpointType enums
CreateResolverRule stored any RuleType string it was given and UpdateResolverEndpoint
copied any ResolverEndpointType through, so Get/ListResolverRules and
GetResolverEndpoint reported values outside botocore's RuleTypeOption
(FORWARD/SYSTEM/RECURSIVE/DELEGATE) and ResolverEndpointType (IPV6/IPV4/DUALSTACK).
Both now reject with the same InvalidParametersException the Direction check uses.
* fix(route53resolver): reject an empty TargetIps list
The model pins TargetIps to list min 1; a present-but-empty array was
stored verbatim. Absent stays allowed for SYSTEM rules. Found by the
botocore-grounded review pipeline; the hand audit missed it.
* fix(route53resolver): make the CreatorRequestId replay check atomic
Two overlapping create retries with the same token could both pass the
replay scan before either put, persisting two resources with different
ids. The three create methods are now synchronized, making the
scan-then-put pair atomic on this ApplicationScoped singleton.
* fix(route53resolver): scope the CreatorRequestId replay to the request's region
replayOf matched purely on CreatorRequestId content across the whole
account-partitioned store, which carries no region in its keys. The same
account replaying a token in a second region got the first region's
resource and ARN back instead of the regional resource it asked for.
Route 53 Resolver is regional, so a token identifies one resource per
region: match the candidate's region too, taken from the ARN this service
builds rather than a stored field, so nothing new reaches the wire.
Also folds the two stacked javadoc blocks above replayOf into one; the
second was shadowing the first, which left the idempotency contract out
of the generated docs.
* docs: correct service count to 79 after the #2579 merge
The upstream/main merge (ca772bc72) added two new services
(servicequotas, ram) on top of this branch's own route53resolver
addition. The merge-base count was 76; three disjoint new services
(1 ours + 2 upstream) makes 79, not 78 as the merge commit left it.
* fix(config): restore the controltower enabled toggle in both application.yml files
The route53resolver key was inserted between controltower: and the
enabled: true that belonged to it, so controltower: became a bare key
binding nothing and route53resolver adopted its child. Control Tower kept
running only because ControlTowerServiceConfig.enabled() carries
@WithDefault("true"), which masked the break; the explicit toggle was
gone. Caught by ServiceConfigYamlCoverageTest, which names controltower
rather than route53resolver and made the CI failure read as unrelated.
* fix(route53resolver): raise the error codes the model actually names
InvalidParametersException (plural) is a Service Catalog shape and does
not exist anywhere in route53resolver's model. Checked every throw site
against the per-operation error lists in botocore route53resolver
2018-04-01 rather than renaming globally, because the service carries two
vocabularies: the resolver endpoint, rule and association operations model
the singular InvalidParameterException, while the DNS Firewall operations
model ValidationException and do not list InvalidParameterException at all.
CreateFirewallDomainList therefore raises ValidationException; the other
eight sites raise InvalidParameterException. requireText and requireEnum
are shared across both families, so each caller now passes the code its
own operation models instead of the helper picking one. ResourceNotFound
usage was already correct and is untouched.
* fix(route53resolver): reject a CreatorRequestId replayed with different parameters
A replayed token was deduplicated on the token alone, so a retry carrying
different but individually valid parameters got a success response
describing the original resource rather than the one it asked for.
CreateResolverEndpoint and CreateResolverRule now compare the retry
against the stored resource and raise ResourceExistsException, which both
operations model. CreateFirewallDomainList is deliberately left lenient:
its modeled error list carries no conflict error at all, so reporting one
would mean inventing a shape real SDK clients cannot deserialize. That
divergence is pinned by a test and ledgered rather than guessed at.
* fix(route53resolver): compare IP request values, not just their count, on a replayed create
The conflict check compared IpAddressRequests by size, so a retry reusing
a CreatorRequestId with the same number of entries but a different subnet
or address was treated as an equivalent replay and returned the original
endpoint, dropping the configuration the caller actually asked for.
The modeled ResolverEndpoint shape carries IpAddressCount and no IP list,
and the handlers return the stored node verbatim, so the addresses are
recorded in a side store keyed by endpoint id rather than on the resource
itself; nothing new reaches the wire. Comparison is order-insensitive so a
reordered retry is still a replay, and endpoints created before this
record existed fall back to the count comparison instead of reporting a
conflict on every retry.
* fix(route53resolver): treat a missing IP-request record as a conflict, not a pass
The fallback for an endpoint with no recorded IpAddressRequests compared
IpAddressCount instead, which accepts a retry that keeps the count but
changes a subnet or address — exactly the case the record exists to catch.
That made it a silently wrong check rather than a lenient one.
With nothing to compare against, sameness cannot be established, so the
retry is now reported as ResourceExistsException. A spurious conflict is
loud and recoverable; a wrong success is neither. Nothing released can
reach this state: the endpoint store is new in the same change as the
record, so the only ways in are a write interrupted between the two stores
or state from an intermediate build of this branch.
Adds a package-private constructor so a hermetic test can create the
missing-record state the public API cannot, following the pattern in
Ec2IpamService. The cost of failing closed — an identical retry also
conflicting — is pinned as its own test rather than left implicit.
* fix(route53resolver): order IP requests by a member-order-independent key
The replay comparison sorted IpAddressRequests by JsonNode.toString, which
serialises members in insertion order. A retry carrying the same addresses
with the members written in a different order could sort the entries into a
different sequence, so an equivalent request was rejected as a conflict.
Sort by a canonical key that ignores member order instead. Both sides are
re-normalised at comparison time rather than trusting the stored order, so
a record written before this fix still compares as equal.
6.4 KiB
Route 53 Resolver
Supported Actions
| Action | Description |
|---|---|
ListFirewallDomainLists |
Lists all DNS Firewall domain lists, including the four AWS-managed lists computed per region. |
GetFirewallDomainList |
Returns a single DNS Firewall domain list by id, whether AWS-managed or custom. |
CreateFirewallDomainList |
Creates a custom DNS Firewall domain list with a random-suffix rslvr-fdl- id. |
DeleteFirewallDomainList |
Deletes a custom DNS Firewall domain list; AWS-managed lists cannot be deleted. |
CreateResolverEndpoint |
Creates an inbound (rslvr-in-) or outbound (rslvr-out-) resolver endpoint, returned immediately as OPERATIONAL. |
DeleteResolverEndpoint |
Deletes a resolver endpoint and returns its final description. |
GetResolverEndpoint |
Returns a resolver endpoint by id. |
ListResolverEndpoints |
Lists all resolver endpoints. |
UpdateResolverEndpoint |
Updates a resolver endpoint's Name and ResolverEndpointType; IpAddresses changes are not modelled. |
CreateResolverRule |
Creates a resolver rule, returned immediately as COMPLETE; ResolverEndpointId is not validated against an existing endpoint. |
DeleteResolverRule |
Deletes a resolver rule and returns its final description. |
GetResolverRule |
Returns a resolver rule by id. |
ListResolverRules |
Lists all resolver rules. |
UpdateResolverRule |
Updates a resolver rule's mutable configuration. |
AssociateResolverRule |
Associates a resolver rule with a VPC, returned immediately as COMPLETE. |
DisassociateResolverRule |
Removes the association between a resolver rule and a VPC. |
GetResolverRuleAssociation |
Returns a resolver rule association by id. |
ListResolverRuleAssociations |
Lists all resolver rule associations. |
Design notes
The four AWS-managed DNS Firewall domain lists (AWSManagedDomainsAggregateThreatList
and friends) are computed on every call from a fixed name list, with ids derived
deterministically from region+name (SHA-256 based) rather than stored — LZA's
Custom::ResolverManagedDomainList Lambda resolves a managed list's Id by Name and
needs it present and stable without any create call. This logic predates the rest of
this service and is untouched.
Everything else (custom firewall domain lists, resolver endpoints, resolver rules,
rule associations) is backed by real per-service storage, added this session. Ids use
the project's standard random-suffix convention (rslvr-fdl-..., rslvr-in-... /
rslvr-out-..., rslvr-rr-..., rslvr-rrassoc-...), distinct from the deterministic
managed-list ids. Resolver endpoint ids are direction-aware as in AWS: rslvr-in- for
INBOUND (and INBOUND_DELEGATION), rslvr-out- for OUTBOUND. Any other Direction
is rejected with InvalidParameterException.
Parameter rejections use the error code the operation actually models, which differs by
family: the resolver endpoint, rule and association operations model the singular
InvalidParameterException, while the DNS Firewall operations model ValidationException
and do not list InvalidParameterException at all.
CreateFirewallDomainList, CreateResolverEndpoint and CreateResolverRule are
idempotent on CreatorRequestId, as they are in real AWS: replaying a token returns the
resource it originally created instead of allocating a second one. The check runs after
the request's own validation, so a replayed token never excuses a malformed body. A
request without a CreatorRequestId opts out and always allocates a new resource.
Idempotency is scoped per account and per region, matching this regional service: the same
token replayed in another region creates that region's own resource rather than handing
back the first region's.
A token replayed with different parameters is a conflict, not a retry:
CreateResolverEndpoint and CreateResolverRule compare the retry against the stored
resource and raise ResourceExistsException, which both operations model.
CreateFirewallDomainList is the deliberate exception — it models no conflict error at
all, so a mismatched retry still returns the original list rather than an invented error
code. See issues/route53resolver-firewall-domain-list-retry-conflict.md.
For CreateResolverEndpoint the comparison covers the actual IpAddressRequests entries,
not just how many there are, so a retry that keeps the count but changes a subnet or
address is a conflict. Order is not significant. The modelled ResolverEndpoint shape has
IpAddressCount and no IP list, so the addresses are recorded in a side store rather than
on the resource and never reach the response. If that record is ever missing for a stored
endpoint, the retry is reported as a conflict rather than compared on count alone — with
nothing to compare against, sameness cannot be established, and a loud error is preferable
to a success that may not match the request.
Limitations
- All create/update operations complete synchronously. Real AWS transitions a
resolver endpoint through
CREATING, a resolver rule through its own provisioning states, before reaching a terminal status. This emulator returns the terminal state (OPERATIONALfor endpoints,COMPLETEfor rules and associations) immediately — matching the "validate-and-echo" convention used elsewhere in this codebase (seeServiceCatalogService.copyProduct,CS-021). UpdateResolverEndpointonly appliesNameandResolverEndpointType. Real AWS additionally allows updatingIpAddresses(adding/removing resolver IPs); that is not modelled.CreateResolverRule/UpdateResolverRuledo not validateResolverEndpointIdagainst an existing endpoint. Any non-blank string is accepted.- No VPC-scoping or region-scoping is enforced for custom resources. The four
stores go through
StorageFactory, so every key is prefixed with the calling credential's account id and custom resources are isolated per account: one account cannot read, update or delete another's endpoints, rules, associations or domain lists. Neither region nor VPC is part of the key, though, so a custom resource created in one region is visible from every other, andVPCIdon an association is stored but never used to filter. The AWS-managed domain lists are the deliberate exception: they are derived per region from the name list rather than stored, so they are region-scoped and visible to every caller, as they are in AWS.