addRegion method

Future<AddRegionResponse> addRegion({
  1. required String instanceArn,
  2. required String regionName,
})

Adds a Region to an IAM Identity Center instance. This operation initiates an asynchronous workflow to replicate the IAM Identity Center instance to the target Region. The Region status is set to ADDING at first and changes to ACTIVE when the workflow completes.

To use this operation, your IAM Identity Center instance and the target Region must meet the requirements described in the IAM Identity Center User Guide.

The following actions are related to AddRegion:

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter instanceArn : The Amazon Resource Name (ARN) of the IAM Identity Center instance to replicate to the target Region.

Parameter regionName : The name of the Amazon Web Services Region to add to the IAM Identity Center instance. The Region name must be 1-32 characters long and follow the pattern of Amazon Web Services Region names (for example, us-east-1).

Implementation

Future<AddRegionResponse> addRegion({
  required String instanceArn,
  required String regionName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SWBExternalService.AddRegion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceArn': instanceArn,
      'RegionName': regionName,
    },
  );

  return AddRegionResponse.fromJson(jsonResponse.body);
}