create_firewall_rule
async
¶
create_firewall_rule(
action: FirewallRuleAction,
name: ResourceName,
dns_view_id: ResourceId,
*,
config_overrides: Optional[AsyncRoute53GlobalResolverClientConfig] = None,
block_override_dns_type: Optional[BlockOverrideDnsQueryType] = None,
block_override_domain: Optional[Domain] = None,
block_override_ttl: Optional[BlockOverrideTtl] = None,
block_response: Optional[FirewallBlockResponse] = None,
client_token: Optional[ClientToken] = None,
confidence_threshold: Optional[ConfidenceThreshold] = None,
description: Optional[ResourceDescription] = None,
dns_advanced_protection: Optional[DnsAdvancedProtection] = None,
firewall_domain_list_id: Optional[ResourceId] = None,
priority: Optional[FirewallRulePriority] = None,
q_type: Optional[DnsQueryType] = None,
) -> CreateFirewallRuleOutput
Creates a DNS firewall rule. Firewall rules define actions (ALLOW, BLOCK, or ALERT) to take on DNS queries that match specified domain lists, managed domain lists, or advanced threat protections.
Route 53 Global Resolver is a global service that supports resolvers in multiple Amazon Web Services Regions but you must specify the US East (Ohio) Region to create, update, or otherwise work with Route 53 Global Resolver resources. That is, for example, specify --region us-east-2 on Amazon Web Services CLI commands.
Parameters:
-
action(FirewallRuleAction) –The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list:
-
ALLOW- Permit the request to go through. -
ALERT- Permit the request and send metrics and logs to CloudWatch. -
BLOCK- Disallow the request. This option requires additional details in the rule'sBlockResponse.
-
-
block_override_dns_type(Optional[BlockOverrideDnsQueryType], default:None) –The DNS record's type. This determines the format of the record value that you provided in
BlockOverrideDomain. Used for the rule actionBLOCKwith aBlockResponsesetting ofOVERRIDE.This setting is required if the
BlockResponsesetting isOVERRIDE. -
block_override_domain(Optional[Domain], default:None) –The custom DNS record to send back in response to the query. Used for the rule action
BLOCKwith aBlockResponsesetting ofOVERRIDE.This setting is required if the
BlockResponsesetting isOVERRIDE. -
block_override_ttl(Optional[BlockOverrideTtl], default:None) –The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Used for the rule action
BLOCKwith aBlockResponsesetting ofOVERRIDE.This setting is required if the
BlockResponsesetting isOVERRIDE. -
block_response(Optional[FirewallBlockResponse], default:None) –The response to return when the action is BLOCK. Valid values are NXDOMAIN (domain does not exist), NODATA (domain exists but no records), or OVERRIDE (return custom response).
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same
clientTokenhas the same result every time. -
confidence_threshold(Optional[ConfidenceThreshold], default:None) –The confidence threshold for advanced threat detection. Valid values are HIGH, MEDIUM, or LOW, indicating the accuracy level required for threat detection.
-
description(Optional[ResourceDescription], default:None) –An optional description for the firewall rule.
-
dns_advanced_protection(Optional[DnsAdvancedProtection], default:None) –Whether to enable advanced DNS threat protection for this rule. Advanced protection can detect and block DNS tunneling and Domain Generation Algorithm (DGA) threats.
-
firewall_domain_list_id(Optional[ResourceId], default:None) –The ID of the firewall domain list to use in this rule.
-
name(ResourceName) –A descriptive name for the firewall rule.
-
priority(Optional[FirewallRulePriority], default:None) –The priority of this rule. Rules are evaluated in priority order, with lower numbers having higher priority. When a DNS query matches multiple rules, the rule with the highest priority (lowest number) is applied.
-
dns_view_id(ResourceId) –The ID of the DNS view to associate with this firewall rule.
-
q_type(Optional[DnsQueryType], default:None) –The DNS query type to match for this rule. Examples include A (IPv4 address), AAAA (IPv6 address), MX (mail exchange), or TXT (text record).
Raises:
-
AccessDeniedException–You don't have permission to perform this operation. Check your IAM permissions and try again.
-
ConflictException–The request conflicts with the current state of the resource. This can occur when trying to modify a resource that is not in a valid state for the requested operation.
-
InternalServerException–An internal server error occurred. Try again later.
-
ResourceNotFoundException–The specified resource was not found. Verify the resource ID and try again.
-
ServiceQuotaExceededException–The request would exceed one or more service quotas. Check your current usage and quotas, then try again.
-
ThrottlingException–The request was throttled due to too many requests. Wait a moment and try again.
-
ValidationException–The input parameters are invalid. Check the parameter values and try again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_route53globalresolver/_services/async_route53_global_resolver.py
2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 | |