updateManagedInstanceRole method

Future<void> updateManagedInstanceRole({
  1. required String iamRole,
  2. required String instanceId,
})

Changes the Amazon Identity and Access Management (IAM) role that is assigned to the on-premises instance or virtual machines (VM). IAM roles are first assigned to these hybrid instances during the activation process. For more information, see CreateActivation.

May throw InvalidInstanceId. May throw InternalServerError.

Parameter iamRole : The IAM role you want to assign or change.

Parameter instanceId : The ID of the managed instance where you want to update the role.

Implementation

Future<void> updateManagedInstanceRole({
  required String iamRole,
  required String instanceId,
}) async {
  ArgumentError.checkNotNull(iamRole, 'iamRole');
  _s.validateStringLength(
    'iamRole',
    iamRole,
    0,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.UpdateManagedInstanceRole'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IamRole': iamRole,
      'InstanceId': instanceId,
    },
  );
}