putFirewallRuleGroupPolicy method

Future<PutFirewallRuleGroupPolicyResponse> putFirewallRuleGroupPolicy({
  1. required String arn,
  2. required String firewallRuleGroupPolicy,
})

Attaches an Identity and Access Management (Amazon Web Services IAM) policy for sharing the rule group. You can use the policy to share the rule group using Resource Access Manager (RAM).

May throw AccessDeniedException. May throw InternalServiceErrorException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter arn : The ARN (Amazon Resource Name) for the rule group that you want to share.

Parameter firewallRuleGroupPolicy : The Identity and Access Management (Amazon Web Services IAM) policy to attach to the rule group.

Implementation

Future<PutFirewallRuleGroupPolicyResponse> putFirewallRuleGroupPolicy({
  required String arn,
  required String firewallRuleGroupPolicy,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53Resolver.PutFirewallRuleGroupPolicy'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Arn': arn,
      'FirewallRuleGroupPolicy': firewallRuleGroupPolicy,
    },
  );

  return PutFirewallRuleGroupPolicyResponse.fromJson(jsonResponse.body);
}