associateIamRoleToResource method

Future<void> associateIamRoleToResource({
  1. required SupportedAwsIntegration awsIntegration,
  2. required String iamRoleArn,
  3. required String resourceArn,
})

Associates an Amazon Web Services Identity and Access Management (IAM) service role with a specified resource to enable Amazon Web Services service integration.

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

Parameter awsIntegration : The Amazon Web Services integration configuration settings for the Amazon Web Services Identity and Access Management (IAM) service role association.

Parameter iamRoleArn : The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access Management (IAM) service role to associate with the resource.

Parameter resourceArn : The Amazon Resource Name (ARN) of the target resource to associate with the Amazon Web Services Identity and Access Management (IAM) service role.

Implementation

Future<void> associateIamRoleToResource({
  required SupportedAwsIntegration awsIntegration,
  required String iamRoleArn,
  required String resourceArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Odb.AssociateIamRoleToResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'awsIntegration': awsIntegration.value,
      'iamRoleArn': iamRoleArn,
      'resourceArn': resourceArn,
    },
  );
}