addRoleToDBInstance method
Associates an AWS Identity and Access Management (IAM) role with a DB instance.
May throw DBInstanceNotFoundFault. May throw DBInstanceRoleAlreadyExistsFault. May throw InvalidDBInstanceStateFault. May throw DBInstanceRoleQuotaExceededFault.
Parameter dBInstanceIdentifier
:
The name of the DB instance to associate the IAM role with.
Parameter featureName
:
The name of the feature for the DB instance that the IAM role is to be
associated with. For the list of supported feature names, see
DBEngineVersion.
Parameter roleArn
:
The Amazon Resource Name (ARN) of the IAM role to associate with the DB
instance, for example
arn:aws:iam::123456789012:role/AccessRole
.
Implementation
Future<void> addRoleToDBInstance({
required String dBInstanceIdentifier,
required String featureName,
required String roleArn,
}) async {
ArgumentError.checkNotNull(dBInstanceIdentifier, 'dBInstanceIdentifier');
ArgumentError.checkNotNull(featureName, 'featureName');
ArgumentError.checkNotNull(roleArn, 'roleArn');
final $request = <String, dynamic>{};
$request['DBInstanceIdentifier'] = dBInstanceIdentifier;
$request['FeatureName'] = featureName;
$request['RoleArn'] = roleArn;
await _protocol.send(
$request,
action: 'AddRoleToDBInstance',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['AddRoleToDBInstanceMessage'],
shapes: shapes,
);
}