Skip to content

describe_rule_group

describe_rule_group(
    *,
    config_overrides: Optional[NetworkFirewallClientConfig] = None,
    rule_group_name: Optional[ResourceName] = None,
    rule_group_arn: Optional[ResourceArn] = None,
    type: Optional[RuleGroupType] = None,
    analyze_rule_group: Optional[Boolean] = None,
    rule_output_format: Optional[RuleOutputFormat] = None,
) -> DescribeRuleGroupResponse

Returns the data objects for the specified rule group.

Parameters:

  • rule_group_name (Optional[ResourceName], default: None ) –

    The descriptive name of the rule group. You can't change the name of a rule group after you create it.

    You must specify the ARN or the name, and you can specify both.

  • rule_group_arn (Optional[ResourceArn], default: None ) –

    The Amazon Resource Name (ARN) of the rule group.

    You must specify the ARN or the name, and you can specify both.

  • type (Optional[RuleGroupType], default: None ) –

    Indicates the type of the rule group. Valid values are:

    • STATELESS - Stateless rules, for use in a Classic Network Firewall policy.

    • STATEFUL - Stateful rules, for use in a Classic Network Firewall policy.

    • FIREWALL - Firewall engine rules, for use in a Next Generation policy.

    • IPS - IPS engine rules, for use in a Next Generation policy.

    This setting is required for requests that do not include the RuleGroupARN.

  • analyze_rule_group (Optional[Boolean], default: None ) –

    Indicates whether you want Network Firewall to analyze the stateless rules in the rule group for rule behavior such as asymmetric routing. If set to TRUE, Network Firewall runs the analysis.

  • rule_output_format (Optional[RuleOutputFormat], default: None ) –

    For a firewall engine rule group, the format in which to return the rules. Specify one of the following values:

    • FIREWALL_RULES - Returns the rules as structured FirewallRule objects.

    • RULES_STRING - Returns the rules as a Suricata-compatible firewall-mode rule string.

    If you don't specify a format, Network Firewall returns the rules in the format you provided them in. This setting applies only to FIREWALL and IPS rule groups; IPS engine rule groups support only RULES_STRING.

Raises:

  • InternalServerError –

    Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request.

  • InvalidRequestException –

    The operation failed because of a problem with your request. Examples include:

    • You specified an unsupported parameter name or value.

    • You tried to update a property with a value that isn't among the available types.

    • Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.

  • ResourceNotFoundException –

    Unable to locate a resource using the parameters that you provided.

  • ThrottlingException –

    Unable to process the request due to throttling limitations.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_network_firewall/_services/network_firewall.py
def describe_rule_group(
    self,
    *,
    config_overrides: Optional[NetworkFirewallClientConfig] = None,
    rule_group_name: Optional[
        "capo_network_firewall.types.resource_name.ResourceName"
    ] = None,
    rule_group_arn: Optional[
        "capo_network_firewall.types.resource_arn.ResourceArn"
    ] = None,
    type: Optional[
        "capo_network_firewall.types.rule_group_type.RuleGroupType"
    ] = None,
    analyze_rule_group: Optional[
        "capo_network_firewall.types.boolean.Boolean"
    ] = None,
    rule_output_format: Optional[
        "capo_network_firewall.types.rule_output_format.RuleOutputFormat"
    ] = None,
) -> "capo_network_firewall.types.describe_rule_group_response.DescribeRuleGroupResponse":
    """<p>Returns the data objects for the specified rule group. </p>

    Args:
        rule_group_name: <p>The descriptive name of the rule group. You can't change the name of a rule group after you create it.</p> <p>You must specify the ARN or the name, and you can specify both. </p>
        rule_group_arn: <p>The Amazon Resource Name (ARN) of the rule group.</p> <p>You must specify the ARN or the name, and you can specify both. </p>
        type: <p>Indicates the type of the rule group. Valid values are:</p> <ul> <li> <p> <code>STATELESS</code> - Stateless rules, for use in a Classic Network Firewall policy.</p> </li> <li> <p> <code>STATEFUL</code> - Stateful rules, for use in a Classic Network Firewall policy.</p> </li> <li> <p> <code>FIREWALL</code> - Firewall engine rules, for use in a Next Generation policy.</p> </li> <li> <p> <code>IPS</code> - IPS engine rules, for use in a Next Generation policy.</p> </li> </ul> <note> <p>This setting is required for requests that do not include the <code>RuleGroupARN</code>.</p> </note>
        analyze_rule_group: <p>Indicates whether you want Network Firewall to analyze the stateless rules in the rule group for rule behavior such as asymmetric routing. If set to <code>TRUE</code>, Network Firewall runs the analysis.</p>
        rule_output_format: <p>For a firewall engine rule group, the format in which to return the rules. Specify one of the following values:</p> <ul> <li> <p> <code>FIREWALL_RULES</code> - Returns the rules as structured <code>FirewallRule</code> objects.</p> </li> <li> <p> <code>RULES_STRING</code> - Returns the rules as a Suricata-compatible firewall-mode rule string.</p> </li> </ul> <p>If you don't specify a format, Network Firewall returns the rules in the format you provided them in. This setting applies only to <code>FIREWALL</code> and <code>IPS</code> rule groups; IPS engine rule groups support only <code>RULES_STRING</code>.</p>

    Raises:
        capo_network_firewall.errors.internal_server_error.InternalServerError: <p>Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request. </p>
        capo_network_firewall.errors.invalid_request_exception.InvalidRequestException: <p>The operation failed because of a problem with your request. Examples include: </p> <ul> <li> <p>You specified an unsupported parameter name or value.</p> </li> <li> <p>You tried to update a property with a value that isn't among the available types.</p> </li> <li> <p>Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.</p> </li> </ul>
        capo_network_firewall.errors.resource_not_found_exception.ResourceNotFoundException: <p>Unable to locate a resource using the parameters that you provided.</p>
        capo_network_firewall.errors.throttling_exception.ThrottlingException: <p>Unable to process the request due to throttling limitations.</p>
        capo_network_firewall.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_network_firewall.types.describe_rule_group_request.DescribeRuleGroupRequest]",
    ) -> OperationResponse[
        "capo_network_firewall.types.describe_rule_group_response.DescribeRuleGroupResponse"
    ]:
        if req.options.protocol == "awsJson1_0":
            import capo_network_firewall._operations.network_firewall_20201112.aws_json1_0.describe_rule_group

            output, http_response = (
                capo_network_firewall._operations.network_firewall_20201112.aws_json1_0.describe_rule_group.describe_rule_group(
                    req.options, req.input
                )
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_network_firewall._operations.network_firewall_20201112.rpcv2_cbor.describe_rule_group

            output, http_response = (
                capo_network_firewall._operations.network_firewall_20201112.rpcv2_cbor.describe_rule_group.describe_rule_group(
                    req.options, req.input
                )
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeRuleGroup")
    )
    input_: capo_network_firewall.types.describe_rule_group_request.DescribeRuleGroupRequest = {}
    if rule_group_name is not None:
        input_["rule_group_name"] = rule_group_name
    if rule_group_arn is not None:
        input_["rule_group_arn"] = rule_group_arn
    if type is not None:
        input_["type"] = type
    if analyze_rule_group is not None:
        input_["analyze_rule_group"] = analyze_rule_group
    if rule_output_format is not None:
        input_["rule_output_format"] = rule_output_format

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output