clients/client-route53resolver/README.md
AWS SDK for JavaScript Route53Resolver Client for Node.js, Browser and React Native.
<p>When you create a VPC using Amazon VPC, you automatically get DNS resolution within the VPC from Route 53 Resolver. By default, Resolver answers DNS queries for VPC domain names such as domain names for EC2 instances or Elastic Load Balancing load balancers. Resolver performs recursive lookups against public name servers for all other domain names.</p> <p>You can also configure DNS resolution between your VPC and your network over a Direct Connect or VPN connection:</p> <p> <b>Forward DNS queries from resolvers on your network to Route 53 Resolver</b> </p> <p>DNS resolvers on your network can forward DNS queries to Resolver in a specified VPC. This allows your DNS resolvers to easily resolve domain names for Amazon Web Services resources such as EC2 instances or records in a Route 53 private hosted zone. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver.html#resolver-overview-forward-network-to-vpc">How DNS Resolvers on Your Network Forward DNS Queries to Route 53 Resolver</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p> <b>Conditionally forward queries from a VPC to resolvers on your network</b> </p> <p>You can configure Resolver to forward queries that it receives from EC2 instances in your VPCs to DNS resolvers on your network. To forward selected queries, you create Resolver rules that specify the domain names for the DNS queries that you want to forward (such as example.com), and the IP addresses of the DNS resolvers on your network that you want to forward the queries to. If a query matches multiple rules (example.com, acme.example.com), Resolver chooses the rule with the most specific match (acme.example.com) and forwards the query to the IP addresses that you specified in that rule. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver.html#resolver-overview-forward-vpc-to-network">How Route 53 Resolver Forwards DNS Queries from Your VPCs to Your Network</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>Like Amazon VPC, Resolver is Regional. In each Region where you have VPCs, you can choose whether to forward queries from your VPCs to your network (outbound queries), from your network to your VPCs (inbound queries), or both.</p>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-route53resolveryarn add @aws-sdk/client-route53resolverpnpm add @aws-sdk/client-route53resolverThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the Route53ResolverClient and
the commands you need, for example ListResolverRulesCommand:
// ES5 example
const { Route53ResolverClient, ListResolverRulesCommand } = require("@aws-sdk/client-route53resolver");
// ES6+ example
import { Route53ResolverClient, ListResolverRulesCommand } from "@aws-sdk/client-route53resolver";
To send a request:
send operation on the client, providing the command object as input.const client = new Route53ResolverClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListResolverRulesCommand(params);
We recommend using the await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
Route53Resolver extends Route53ResolverClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (Route53ResolverClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { Route53Resolver } from "@aws-sdk/client-route53resolver";
const client = new Route53Resolver({ region: "REGION" });
// async/await.
try {
const data = await client.listResolverRules(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listResolverRules(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listResolverRules(params, (err, data) => {
// process err and data.
});
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}
See also docs/ERROR_HANDLING.
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-route53resolver package is updated.
To contribute to client you can check our generate clients scripts.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Command API Reference / Input / Output
</details> <details> <summary> AssociateResolverEndpointIpAddress </summary>Command API Reference / Input / Output
</details> <details> <summary> AssociateResolverQueryLogConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> AssociateResolverRule </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateFirewallDomainList </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateFirewallRule </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateFirewallRuleGroup </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateOutpostResolver </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateResolverEndpoint </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateResolverQueryLogConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateResolverRule </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteFirewallDomainList </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteFirewallRule </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteFirewallRuleGroup </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteOutpostResolver </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteResolverEndpoint </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteResolverQueryLogConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteResolverRule </summary>Command API Reference / Input / Output
</details> <details> <summary> DisassociateFirewallRuleGroup </summary>Command API Reference / Input / Output
</details> <details> <summary> DisassociateResolverEndpointIpAddress </summary>Command API Reference / Input / Output
</details> <details> <summary> DisassociateResolverQueryLogConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> DisassociateResolverRule </summary>Command API Reference / Input / Output
</details> <details> <summary> GetFirewallConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> GetFirewallDomainList </summary>Command API Reference / Input / Output
</details> <details> <summary> GetFirewallRuleGroup </summary>Command API Reference / Input / Output
</details> <details> <summary> GetFirewallRuleGroupAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> GetFirewallRuleGroupPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> GetOutpostResolver </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverDnssecConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverEndpoint </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverQueryLogConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverQueryLogConfigAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverQueryLogConfigPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverRule </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverRuleAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResolverRulePolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> ImportFirewallDomains </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFirewallConfigs </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFirewallDomainLists </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFirewallDomains </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFirewallRuleGroupAssociations </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFirewallRuleGroups </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFirewallRules </summary>Command API Reference / Input / Output
</details> <details> <summary> ListOutpostResolvers </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverConfigs </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverDnssecConfigs </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverEndpointIpAddresses </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverEndpoints </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverQueryLogConfigAssociations </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverQueryLogConfigs </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverRuleAssociations </summary>Command API Reference / Input / Output
</details> <details> <summary> ListResolverRules </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTagsForResource </summary>Command API Reference / Input / Output
</details> <details> <summary> PutFirewallRuleGroupPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> PutResolverQueryLogConfigPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> PutResolverRulePolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> TagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UntagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateFirewallConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateFirewallDomains </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateFirewallRule </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateFirewallRuleGroupAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateOutpostResolver </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateResolverConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateResolverDnssecConfig </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateResolverEndpoint </summary> </details> <details> <summary> UpdateResolverRule </summary> </details>