associateFirewallRuleGroup method

Future<AssociateFirewallRuleGroupResponse> associateFirewallRuleGroup({
  1. required String firewallRuleGroupId,
  2. required String name,
  3. required int priority,
  4. required String vpcId,
  5. String? creatorRequestId,
  6. MutationProtectionStatus? mutationProtection,
  7. List<Tag>? tags,
})

Associates a FirewallRuleGroup with a VPC, to provide DNS filtering for the VPC.

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

Parameter firewallRuleGroupId : The unique identifier of the firewall rule group.

Parameter name : A name that lets you identify the association, to manage and use it.

Parameter priority : The setting that determines the processing order of the rule group among the rule groups that you associate with the specified VPC. DNS Firewall filters VPC traffic starting from the rule group with the lowest numeric priority setting.

You must specify a unique priority for each rule group that you associate with a single VPC. To make it easier to insert rule groups later, leave space between the numbers, for example, use 101, 200, and so on. You can change the priority setting for a rule group association after you create it.

The allowed values for Priority are between 100 and 9900.

Parameter vpcId : The unique identifier of the VPC that you want to associate with the rule group.

Parameter creatorRequestId : A unique string that identifies the request and that allows failed requests to be retried without the risk of running the operation twice. CreatorRequestId can be any unique string, for example, a date/time stamp.

Parameter mutationProtection : If enabled, this setting disallows modification or removal of the association, to help prevent against accidentally altering DNS firewall protections. When you create the association, the default setting is DISABLED.

Parameter tags : A list of the tag keys and values that you want to associate with the rule group association.

Implementation

Future<AssociateFirewallRuleGroupResponse> associateFirewallRuleGroup({
  required String firewallRuleGroupId,
  required String name,
  required int priority,
  required String vpcId,
  String? creatorRequestId,
  MutationProtectionStatus? mutationProtection,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53Resolver.AssociateFirewallRuleGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FirewallRuleGroupId': firewallRuleGroupId,
      'Name': name,
      'Priority': priority,
      'VpcId': vpcId,
      'CreatorRequestId': creatorRequestId ?? _s.generateIdempotencyToken(),
      if (mutationProtection != null)
        'MutationProtection': mutationProtection.value,
      if (tags != null) 'Tags': tags,
    },
  );

  return AssociateFirewallRuleGroupResponse.fromJson(jsonResponse.body);
}