createAccessPreview method
Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter analyzerArn :
The ARN
of the account analyzer used to generate the access preview. You can
only create an access preview for analyzers with an Account
type and Active status.
Parameter configurations :
Access control configuration for your resource that is used to generate
the access preview. The access preview includes findings for external
access allowed to the resource with the proposed access control
configuration. The configuration must contain exactly one element.
Parameter clientToken :
A client token.
Implementation
Future<CreateAccessPreviewResponse> createAccessPreview({
required String analyzerArn,
required Map<String, Configuration> configurations,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'analyzerArn': analyzerArn,
'configurations': configurations,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/access-preview',
exceptionFnMap: _exceptionFns,
);
return CreateAccessPreviewResponse.fromJson(response);
}