AWS.Route53Resolver reference
GetResolverEndpoint
Section titled “GetResolverEndpoint”Source:
src/AWS/Route53Resolver/GetResolverEndpoint.ts
Runtime binding for route53resolver:GetResolverEndpoint — read the bound
ResolverEndpoint’s live state (status, IP address count, host VPC,
protocols); the endpoint ID is injected automatically.
Provide Route53Resolver.GetResolverEndpointHttp on the hosting Lambda
Function to satisfy the requirement.
GetResolverEndpoint: Reading Endpoint State
Section titled “GetResolverEndpoint: Reading Endpoint State”// init — grants route53resolver:GetResolverEndpoint on the endpointconst getEndpoint = yield* AWS.Route53Resolver.GetResolverEndpoint(endpoint);
// runtimeconst { ResolverEndpoint } = yield* getEndpoint();console.log(ResolverEndpoint?.Status, ResolverEndpoint?.IpAddressCount);GetResolverRule
Section titled “GetResolverRule”Source:
src/AWS/Route53Resolver/GetResolverRule.ts
Runtime binding for route53resolver:GetResolverRule — read the bound
ResolverRule’s live state (domain name, target IPs, endpoint,
status); the rule ID is injected automatically.
Provide Route53Resolver.GetResolverRuleHttp on the hosting Lambda
Function to satisfy the requirement.
GetResolverRule: Reading Rule State
Section titled “GetResolverRule: Reading Rule State”// init — grants route53resolver:GetResolverRule on the ruleconst getRule = yield* AWS.Route53Resolver.GetResolverRule(rule);
// runtimeconst { ResolverRule } = yield* getRule();const targets = (ResolverRule?.TargetIps ?? []).map((t) => t.Ip);ListResolverEndpointIpAddresses
Section titled “ListResolverEndpointIpAddresses”Source:
src/AWS/Route53Resolver/ListResolverEndpointIpAddresses.ts
Runtime binding for route53resolver:ListResolverEndpointIpAddresses —
discover the IP addresses the bound ResolverEndpoint’s network
interfaces answer/forward on (one per subnet); the endpoint ID is injected
automatically.
The canonical runtime use: DNS bootstrap automation that reads an INBOUND endpoint’s IPs to configure on-premises conditional forwarders (or a VPN / DHCP option set) without hard-coding addresses.
Provide Route53Resolver.ListResolverEndpointIpAddressesHttp on the
hosting Lambda Function to satisfy the requirement.
ListResolverEndpointIpAddresses: Discovering Endpoint IPs
Section titled “ListResolverEndpointIpAddresses: Discovering Endpoint IPs”// init — grants route53resolver:ListResolverEndpointIpAddresses on the endpointconst listIps = yield* AWS.Route53Resolver.ListResolverEndpointIpAddresses(endpoint);
// runtimeconst { IpAddresses } = yield* listIps();const ips = (IpAddresses ?? []).map((ip) => ip.Ip);ListResolverRuleAssociations
Section titled “ListResolverRuleAssociations”Source:
src/AWS/Route53Resolver/ListResolverRuleAssociations.ts
Runtime binding for route53resolver:ListResolverRuleAssociations —
enumerate the VPC associations of the bound ResolverRule. The
request is automatically filtered to the bound rule
(Filters: [{ Name: "ResolverRuleId", … }]).
Provide Route53Resolver.ListResolverRuleAssociationsHttp on the hosting
Lambda Function to satisfy the requirement.
ListResolverRuleAssociations: Reading Rule State
Section titled “ListResolverRuleAssociations: Reading Rule State”// init — grants route53resolver:ListResolverRuleAssociations on the ruleconst listAssociations = yield* AWS.Route53Resolver.ListResolverRuleAssociations(rule);
// runtimeconst { ResolverRuleAssociations } = yield* listAssociations();const vpcIds = (ResolverRuleAssociations ?? []).map((a) => a.VPCId);ResolverEndpoint
Section titled “ResolverEndpoint”Source:
src/AWS/Route53Resolver/ResolverEndpoint.ts
A Route 53 Resolver endpoint — the set of elastic network interfaces that
connect your VPC’s .2 resolver to DNS resolvers on your own network.
An INBOUND endpoint lets DNS resolvers on your network forward queries
to Route 53 Resolver; an OUTBOUND endpoint lets Resolver forward queries
from your VPCs to your network (paired with FORWARD ResolverRules).
Endpoint provisioning is asynchronous (typically 1-2 minutes); the
provider waits (bounded) for the endpoint to become OPERATIONAL so
dependent resolver rules can use it immediately.
ResolverEndpoint: Creating Endpoints
Section titled “ResolverEndpoint: Creating Endpoints”Inbound Endpoint
import * as Route53Resolver from "alchemy/AWS/Route53Resolver";
const inbound = yield* Route53Resolver.ResolverEndpoint("Inbound", { direction: "INBOUND", securityGroupIds: [sg.securityGroupId], ipAddresses: [ { subnetId: subnetA.subnetId }, { subnetId: subnetB.subnetId }, ],});Outbound Endpoint with Fixed IPs
const outbound = yield* Route53Resolver.ResolverEndpoint("Outbound", { direction: "OUTBOUND", securityGroupIds: [sg.securityGroupId], ipAddresses: [ { subnetId: subnetA.subnetId, ip: "10.0.0.10" }, { subnetId: subnetB.subnetId, ip: "10.0.1.10" }, ],});ResolverEndpoint: Forwarding Queries
Section titled “ResolverEndpoint: Forwarding Queries”const rule = yield* Route53Resolver.ResolverRule("CorpForward", { domainName: "corp.example.com", resolverEndpointId: outbound.resolverEndpointId, targetIps: [{ ip: "192.168.1.10" }],});ResolverRule
Section titled “ResolverRule”Source:
src/AWS/Route53Resolver/ResolverRule.ts
A Route 53 Resolver rule — tells Resolver how to handle DNS queries for a domain that originate in your VPCs.
A FORWARD rule sends matching queries through an OUTBOUND
ResolverEndpoint to the DNS resolvers on your network listed in
targetIps. The rule takes effect in a VPC once attached with a
ResolverRuleAssociation.
ResolverRule: Forwarding Rules
Section titled “ResolverRule: Forwarding Rules”import * as Route53Resolver from "alchemy/AWS/Route53Resolver";
const rule = yield* Route53Resolver.ResolverRule("CorpForward", { domainName: "corp.example.com", resolverEndpointId: outbound.resolverEndpointId, targetIps: [{ ip: "192.168.1.10" }, { ip: "192.168.1.11", port: 53 }],});ResolverRule: Attaching to VPCs
Section titled “ResolverRule: Attaching to VPCs”const association = yield* Route53Resolver.ResolverRuleAssociation( "CorpForwardAssoc", { resolverRuleId: rule.resolverRuleId, vpcId: vpc.vpcId, },);ResolverRuleAssociation
Section titled “ResolverRuleAssociation”Source:
src/AWS/Route53Resolver/ResolverRuleAssociation.ts
An association between a Route 53 Resolver rule and a VPC. Once associated, Resolver applies the rule to DNS queries that originate in that VPC.
ResolverRuleAssociation: Associating Rules
Section titled “ResolverRuleAssociation: Associating Rules”import * as Route53Resolver from "alchemy/AWS/Route53Resolver";
const association = yield* Route53Resolver.ResolverRuleAssociation( "CorpForwardAssoc", { resolverRuleId: rule.resolverRuleId, vpcId: vpc.vpcId, },);UpdateResolverRule
Section titled “UpdateResolverRule”Source:
src/AWS/Route53Resolver/UpdateResolverRule.ts
Runtime binding for route53resolver:UpdateResolverRule — update the
bound ResolverRule’s mutable configuration (name, target IPs,
outbound endpoint); the rule ID is injected automatically.
The canonical runtime use: DNS failover automation — a Lambda health-checks
the on-premises resolvers a FORWARD rule targets and swaps TargetIps to
the healthy set when one goes dark.
Provide Route53Resolver.UpdateResolverRuleHttp on the hosting Lambda
Function to satisfy the requirement.
UpdateResolverRule: Updating Rules at Runtime
Section titled “UpdateResolverRule: Updating Rules at Runtime”// init — grants route53resolver:UpdateResolverRule on the ruleconst updateRule = yield* AWS.Route53Resolver.UpdateResolverRule(rule);
// runtimeyield* updateRule({ Config: { TargetIps: [{ Ip: "192.168.2.10", Port: 53 }] },});