updateIpRestriction method

Future<UpdateIpRestrictionResponse> updateIpRestriction({
  1. required String awsAccountId,
  2. bool? enabled,
  3. Map<String, String>? ipRestrictionRuleMap,
  4. Map<String, String>? vpcEndpointIdRestrictionRuleMap,
  5. Map<String, String>? vpcIdRestrictionRuleMap,
})

Updates the content and status of IP rules. Traffic from a source is allowed when the source satisfies either the IpRestrictionRule, VpcIdRestrictionRule, or VpcEndpointIdRestrictionRule. To use this operation, you must provide the entire map of rules. You can use the DescribeIpRestriction operation to get the current rule map.

May throw AccessDeniedException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the IP rules.

Parameter enabled : A value that specifies whether IP rules are turned on.

Parameter ipRestrictionRuleMap : A map that describes the updated IP rules with CIDR ranges and descriptions.

Parameter vpcEndpointIdRestrictionRuleMap : A map of allowed VPC endpoint IDs and their corresponding rule descriptions.

Parameter vpcIdRestrictionRuleMap : A map of VPC IDs and their corresponding rules. When you configure this parameter, traffic from all VPC endpoints that are present in the specified VPC is allowed.

Implementation

Future<UpdateIpRestrictionResponse> updateIpRestriction({
  required String awsAccountId,
  bool? enabled,
  Map<String, String>? ipRestrictionRuleMap,
  Map<String, String>? vpcEndpointIdRestrictionRuleMap,
  Map<String, String>? vpcIdRestrictionRuleMap,
}) async {
  final $payload = <String, dynamic>{
    if (enabled != null) 'Enabled': enabled,
    if (ipRestrictionRuleMap != null)
      'IpRestrictionRuleMap': ipRestrictionRuleMap,
    if (vpcEndpointIdRestrictionRuleMap != null)
      'VpcEndpointIdRestrictionRuleMap': vpcEndpointIdRestrictionRuleMap,
    if (vpcIdRestrictionRuleMap != null)
      'VpcIdRestrictionRuleMap': vpcIdRestrictionRuleMap,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/ip-restriction',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateIpRestrictionResponse.fromJson(response);
}