create_resolver_rule
¶
create_resolver_rule(
creator_request_id: CreatorRequestId,
rule_type: RuleTypeOption,
*,
config_overrides: Optional[Route53ResolverClientConfig] = None,
name: Optional[Name] = None,
domain_name: Optional[DomainName] = None,
target_ips: Optional[TargetList] = None,
resolver_endpoint_id: Optional[ResourceId] = None,
tags: Optional[TagList] = None,
delegation_record: Optional[DelegationRecord] = None,
) -> CreateResolverRuleResponse
For DNS queries that originate in your VPCs, specifies which Resolver endpoint the queries pass through, one domain name that you want to forward to your network, and the IP addresses of the DNS resolvers in your network.
Parameters:
-
creator_request_id(CreatorRequestId) –A unique string that identifies the request and that allows failed requests to be retried without the risk of running the operation twice.
CreatorRequestIdcan be any unique string, for example, a date/time stamp. -
name(Optional[Name], default:None) –A friendly name that lets you easily find a rule in the Resolver dashboard in the Route 53 console.
The name can be up to 64 characters long and can contain letters (a-z, A-Z), numbers (0-9), hyphens (-), underscores (_), and spaces. The name cannot consist of only numbers.
-
rule_type(RuleTypeOption) –When you want to forward DNS queries for specified domain name to resolvers on your network, specify
FORWARDorDELEGATE.When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver to process queries for a subdomain of that domain, specify
SYSTEM.For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and specify
FORWARDforRuleType. To then have Resolver process queries for apex.example.com, you create a rule and specifySYSTEMforRuleType.Currently, only Resolver can create rules that have a value of
RECURSIVEforRuleType. -
domain_name(Optional[DomainName], default:None) –DNS queries for this domain name are forwarded to the IP addresses that you specify in
TargetIps. If a query matches multiple Resolver rules (example.com and www.example.com), outbound DNS queries are routed using the Resolver rule that contains the most specific domain name (www.example.com). -
target_ips(Optional[TargetList], default:None) –The IPs that you want Resolver to forward DNS queries to. You can specify either Ipv4 or Ipv6 addresses but not both in the same rule. Separate IP addresses with a space.
TargetIpsis available only when the value ofRule typeisFORWARD. You should not provide TargetIps when the Rule type isDELEGATE.when creating a DELEGATE rule, you must not provide the
TargetIpsparameter. If you provide theTargetIps, you may receive an ERROR message similar to "Delegate resolver rules need to specify a nameserver name". This error means you should not provideTargetIps. -
resolver_endpoint_id(Optional[ResourceId], default:None) –The ID of the outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses that you specify in
TargetIps. -
tags(Optional[TagList], default:None) –A list of the tag keys and values that you want to associate with the endpoint.
-
delegation_record(Optional[DelegationRecord], default:None) –DNS queries with the delegation records that match this domain name are forwarded to the resolvers on your network.
Raises:
-
AccessDeniedException–The current account doesn't have the IAM permissions required to perform the specified Resolver operation.
This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.
-
InternalServiceErrorException–We encountered an unknown error. Try again in a few minutes.
-
InvalidParameterException–One or more parameters in this request are not valid.
-
InvalidRequestException–The request is invalid.
-
LimitExceededException–The request caused one or more limits to be exceeded.
-
ResourceExistsException–The resource that you tried to create already exists.
-
ResourceNotFoundException–The specified resource doesn't exist.
-
ResourceUnavailableException–The specified resource isn't available.
-
ThrottlingException–The request was throttled. Try again in a few minutes.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_route53resolver/_services/route53_resolver.py
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 | |