createProxyRules method

Future<CreateProxyRulesResponse> createProxyRules({
  1. required CreateProxyRulesByRequestPhase rules,
  2. String? proxyRuleGroupArn,
  3. String? proxyRuleGroupName,
})

Creates Network Firewall ProxyRule resources.

Attaches new proxy rule(s) to an existing proxy rule group.

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

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

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 proxyRuleGroupArn : The Amazon Resource Name (ARN) of a proxy rule group.

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

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.

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

Implementation

Future<CreateProxyRulesResponse> createProxyRules({
  required CreateProxyRulesByRequestPhase rules,
  String? proxyRuleGroupArn,
  String? proxyRuleGroupName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'NetworkFirewall_20201112.CreateProxyRules'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Rules': rules,
      if (proxyRuleGroupArn != null) 'ProxyRuleGroupArn': proxyRuleGroupArn,
      if (proxyRuleGroupName != null)
        'ProxyRuleGroupName': proxyRuleGroupName,
    },
  );

  return CreateProxyRulesResponse.fromJson(jsonResponse.body);
}