associateServiceRoleToAccount method

Future<AssociateServiceRoleToAccountResponse> associateServiceRoleToAccount({
  1. required String roleArn,
})

Associates a role with your account. AWS IoT Greengrass will use the role to access your Lambda functions and AWS IoT resources. This is necessary for deployments to succeed. The role must have at least minimum permissions in the policy ''AWSGreengrassResourceAccessRolePolicy''.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter roleArn : The ARN of the service role you wish to associate with your account.

Implementation

Future<AssociateServiceRoleToAccountResponse> associateServiceRoleToAccount({
  required String roleArn,
}) async {
  ArgumentError.checkNotNull(roleArn, 'roleArn');
  final $payload = <String, dynamic>{
    'RoleArn': roleArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/greengrass/servicerole',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateServiceRoleToAccountResponse.fromJson(response);
}