attachRuleGroupsToProxyConfiguration method
Attaches ProxyRuleGroup resources to a ProxyConfiguration
A Proxy Configuration defines the monitoring and protection behavior for a Proxy. The details of the behavior are defined in the rule groups that you add to your configuration.
May throw InternalServerError.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter ruleGroups :
The proxy rule group(s) to attach to the proxy configuration
Parameter updateToken :
A token used for optimistic locking. Network Firewall returns a token to
your requests that access the proxy configuration. The token marks the
state of the proxy configuration resource at the time of the request.
To make changes to the proxy configuration, you provide the token in your
request. Network Firewall uses the token to ensure that the proxy
configuration hasn't changed since you last retrieved it. If it has
changed, the operation fails with an InvalidTokenException.
If this happens, retrieve the proxy configuration again to get a current
copy of it with a current token. Reapply your changes as needed, then try
the operation again using the new token.
Parameter proxyConfigurationArn :
The Amazon Resource Name (ARN) of a proxy configuration.
You must specify the ARN or the name, and you can specify both.
Parameter proxyConfigurationName :
The descriptive name of the proxy configuration. You can't change the name
of a proxy configuration after you create it.
You must specify the ARN or the name, and you can specify both.
Implementation
Future<AttachRuleGroupsToProxyConfigurationResponse>
attachRuleGroupsToProxyConfiguration({
required List<ProxyRuleGroupAttachment> ruleGroups,
required String updateToken,
String? proxyConfigurationArn,
String? proxyConfigurationName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target':
'NetworkFirewall_20201112.AttachRuleGroupsToProxyConfiguration'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'RuleGroups': ruleGroups,
'UpdateToken': updateToken,
if (proxyConfigurationArn != null)
'ProxyConfigurationArn': proxyConfigurationArn,
if (proxyConfigurationName != null)
'ProxyConfigurationName': proxyConfigurationName,
},
);
return AttachRuleGroupsToProxyConfigurationResponse.fromJson(
jsonResponse.body);
}