attachManagedPolicyToPermissionSet method

Future<void> attachManagedPolicyToPermissionSet({
  1. required String instanceArn,
  2. required String managedPolicyArn,
  3. required String permissionSetArn,
})

Attaches an Amazon Web Services managed policy ARN to a permission set.

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

Parameter instanceArn : The ARN of the IAM Identity Center instance under which the operation will be executed. For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces in the Amazon Web Services General Reference.

Parameter managedPolicyArn : The Amazon Web Services managed policy ARN to be attached to a permission set.

Parameter permissionSetArn : The ARN of the PermissionSet that the managed policy should be attached to.

Implementation

Future<void> attachManagedPolicyToPermissionSet({
  required String instanceArn,
  required String managedPolicyArn,
  required String permissionSetArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SWBExternalService.AttachManagedPolicyToPermissionSet'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceArn': instanceArn,
      'ManagedPolicyArn': managedPolicyArn,
      'PermissionSetArn': permissionSetArn,
    },
  );
}