createProxyRuleGroup method

Future<CreateProxyRuleGroupResponse> createProxyRuleGroup({
  1. required String proxyRuleGroupName,
  2. String? description,
  3. ProxyRulesByRequestPhase? rules,
  4. List<Tag>? tags,
})

Creates an Network Firewall ProxyRuleGroup

Collections of related proxy filtering rules. Rule groups help you manage and reuse sets of rules across multiple proxy configurations.

To manage a proxy rule group's tags, use the standard Amazon Web Services resource tagging operations, ListTagsForResource, TagResource, and UntagResource.

To retrieve information about proxy rule groups, use ListProxyRuleGroups and DescribeProxyRuleGroup.

To retrieve information about individual proxy rules, use DescribeProxyRuleGroup and DescribeProxyRule.

May throw InternalServerError. May throw InvalidRequestException. May throw LimitExceededException. May throw ThrottlingException.

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

Parameter description : A description of the proxy rule group.

Parameter rules : Individual rules that define match conditions and actions for application-layer traffic. Rules specify what to inspect (domains, headers, methods) and what action to take (allow, deny, alert).

Parameter tags : The key:value pairs to associate with the resource.

Implementation

Future<CreateProxyRuleGroupResponse> createProxyRuleGroup({
  required String proxyRuleGroupName,
  String? description,
  ProxyRulesByRequestPhase? rules,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'NetworkFirewall_20201112.CreateProxyRuleGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProxyRuleGroupName': proxyRuleGroupName,
      if (description != null) 'Description': description,
      if (rules != null) 'Rules': rules,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateProxyRuleGroupResponse.fromJson(jsonResponse.body);
}