create_firewall_rule
¶
create_firewall_rule(
action: FirewallRuleAction,
name: ResourceName,
dns_view_id: ResourceId,
*,
config_overrides: Optional[Route53GlobalResolverClientConfig] = 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/route53_global_resolver.py
2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 | |