Deletes the specified firewall rule. Identify the rule using either FirewallDomainListId (for domain-list and DNS Firewall Advanced rules) or FirewallThreatProtectionId (for partner-managed and DNS Firewall Advanced rules) — together with FirewallRuleGroupId.
DeleteFirewallRule is the only operation that succeeds against a rule whose Status is CREATION_FAILED.
Parameters:
-
firewall_rule_group_id
(ResourceId)
–
The unique identifier of the firewall rule group that you want to delete the rule from.
-
firewall_domain_list_id
(Optional[ResourceId], default:
None
)
–
The ID of the domain list that's used in the rule.
-
firewall_threat_protection_id
(Optional[ResourceId], default:
None
)
–
The ID that is created for a DNS Firewall Advanced rule.
-
qtype
(Optional[Qtype], default:
None
)
–
The DNS query type that the rule you are deleting evaluates. Allowed values are;
-
A: Returns an IPv4 address.
-
AAAA: Returns an Ipv6 address.
-
CAA: Restricts CAs that can create SSL/TLS certifications for the domain.
-
CNAME: Returns another domain name.
-
DS: Record that identifies the DNSSEC signing key of a delegated zone.
-
MX: Specifies mail servers.
-
NAPTR: Regular-expression-based rewriting of domain names.
-
NS: Authoritative name servers.
-
PTR: Maps an IP address to a domain name.
-
SOA: Start of authority record for the zone.
-
SPF: Lists the servers authorized to send emails from a domain.
-
SRV: Application specific values that identify servers.
-
TXT: Verifies email senders and application-specific values.
-
A query type you define by using the DNS type ID, for example 28 for AAAA. The values must be defined as TYPENUMBER, where the NUMBER can be 1-65534, for example, TYPE28. For more information, see List of DNS record types.
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.
-
ResourceNotFoundException
–
The specified resource doesn't exist.
-
ThrottlingException
–
The request was throttled. Try again in a few minutes.
-
ValidationException
–
You have provided an invalid command. If you ran the UpdateFirewallDomains request. supported values are ADD, REMOVE, or REPLACE a domain.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_route53resolver/_services/route53_resolver.py
| def delete_firewall_rule(
self,
firewall_rule_group_id: "capo_route53resolver.types.resource_id.ResourceId",
*,
config_overrides: Optional[Route53ResolverClientConfig] = None,
firewall_domain_list_id: Optional[
"capo_route53resolver.types.resource_id.ResourceId"
] = None,
firewall_threat_protection_id: Optional[
"capo_route53resolver.types.resource_id.ResourceId"
] = None,
qtype: Optional["capo_route53resolver.types.qtype.Qtype"] = None,
) -> "capo_route53resolver.types.delete_firewall_rule_response.DeleteFirewallRuleResponse":
"""<p>Deletes the specified firewall rule. Identify the rule using either <code>FirewallDomainListId</code> (for domain-list and DNS Firewall Advanced rules) or <code>FirewallThreatProtectionId</code> (for partner-managed and DNS Firewall Advanced rules) — together with <code>FirewallRuleGroupId</code>.</p> <p> <code>DeleteFirewallRule</code> is the only operation that succeeds against a rule whose <code>Status</code> is <code>CREATION_FAILED</code>.</p>
Args:
firewall_rule_group_id: <p>The unique identifier of the firewall rule group that you want to delete the rule from. </p>
firewall_domain_list_id: <p>The ID of the domain list that's used in the rule. </p>
firewall_threat_protection_id: <p> The ID that is created for a DNS Firewall Advanced rule. </p>
qtype: <p> The DNS query type that the rule you are deleting evaluates. Allowed values are; </p> <ul> <li> <p> A: Returns an IPv4 address.</p> </li> <li> <p>AAAA: Returns an Ipv6 address.</p> </li> <li> <p>CAA: Restricts CAs that can create SSL/TLS certifications for the domain.</p> </li> <li> <p>CNAME: Returns another domain name.</p> </li> <li> <p>DS: Record that identifies the DNSSEC signing key of a delegated zone.</p> </li> <li> <p>MX: Specifies mail servers.</p> </li> <li> <p>NAPTR: Regular-expression-based rewriting of domain names.</p> </li> <li> <p>NS: Authoritative name servers.</p> </li> <li> <p>PTR: Maps an IP address to a domain name.</p> </li> <li> <p>SOA: Start of authority record for the zone.</p> </li> <li> <p>SPF: Lists the servers authorized to send emails from a domain.</p> </li> <li> <p>SRV: Application specific values that identify servers.</p> </li> <li> <p>TXT: Verifies email senders and application-specific values.</p> </li> <li> <p>A query type you define by using the DNS type ID, for example 28 for AAAA. The values must be defined as TYPENUMBER, where the NUMBER can be 1-65534, for example, TYPE28. For more information, see <a href="https://en.wikipedia.org/wiki/List_of_DNS_record_types">List of DNS record types</a>.</p> </li> </ul>
Raises:
capo_route53resolver.errors.access_denied_exception.AccessDeniedException: <p>The current account doesn't have the IAM permissions required to perform the specified Resolver operation.</p> <p>This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.</p>
capo_route53resolver.errors.internal_service_error_exception.InternalServiceErrorException: <p>We encountered an unknown error. Try again in a few minutes.</p>
capo_route53resolver.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
capo_route53resolver.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Try again in a few minutes.</p>
capo_route53resolver.errors.validation_exception.ValidationException: <p>You have provided an invalid command. If you ran the <code>UpdateFirewallDomains</code> request. supported values are <code>ADD</code>, <code>REMOVE</code>, or <code>REPLACE</code> a domain.</p>
capo_route53resolver.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_route53resolver.types.delete_firewall_rule_request.DeleteFirewallRuleRequest]",
) -> OperationResponse[
"capo_route53resolver.types.delete_firewall_rule_response.DeleteFirewallRuleResponse"
]:
import capo_route53resolver._operations.route53_resolver.delete_firewall_rule
output, http_response = (
capo_route53resolver._operations.route53_resolver.delete_firewall_rule.delete_firewall_rule(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteFirewallRule")
)
input_: capo_route53resolver.types.delete_firewall_rule_request.DeleteFirewallRuleRequest = {
"firewall_rule_group_id": firewall_rule_group_id
}
if firewall_domain_list_id is not None:
input_["firewall_domain_list_id"] = firewall_domain_list_id
if firewall_threat_protection_id is not None:
input_["firewall_threat_protection_id"] = firewall_threat_protection_id
if qtype is not None:
input_["qtype"] = qtype
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|