removeRegion method
Removes an additional Region from an IAM Identity Center instance. This operation initiates an asynchronous workflow to clean up IAM Identity Center resources in the specified additional Region. The Region status is set to REMOVING and the Region record is deleted when the workflow completes. The request must be made from the primary Region. The target Region cannot be the primary Region, and no other add or remove Region workflows can be in progress.
The following actions are related to RemoveRegion:
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter instanceArn :
The Amazon Resource Name (ARN) of the IAM Identity Center instance.
Parameter regionName :
The name of the Amazon Web Services Region to remove from 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).
The primary Region cannot be removed.
Implementation
Future<RemoveRegionResponse> removeRegion({
required String instanceArn,
required String regionName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SWBExternalService.RemoveRegion'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InstanceArn': instanceArn,
'RegionName': regionName,
},
);
return RemoveRegionResponse.fromJson(jsonResponse.body);
}