addRoleToDBCluster method
Associates an Identity and Access Management (IAM) role from an Amazon Aurora DB cluster. For more information, see Authorizing Amazon Aurora MySQL to Access Other AWS Services on Your Behalf in the Amazon Aurora User Guide.
May throw DBClusterNotFoundFault. May throw DBClusterRoleAlreadyExistsFault. May throw InvalidDBClusterStateFault. May throw DBClusterRoleQuotaExceededFault.
Parameter dBClusterIdentifier
:
The name of the DB cluster to associate the IAM role with.
Parameter roleArn
:
The Amazon Resource Name (ARN) of the IAM role to associate with the
Aurora DB cluster, for example,
arn:aws:iam::123456789012:role/AuroraAccessRole
.
Parameter featureName
:
The name of the feature for the DB cluster that the IAM role is to be
associated with. For the list of supported feature names, see
DBEngineVersion.
Implementation
Future<void> addRoleToDBCluster({
required String dBClusterIdentifier,
required String roleArn,
String? featureName,
}) async {
ArgumentError.checkNotNull(dBClusterIdentifier, 'dBClusterIdentifier');
ArgumentError.checkNotNull(roleArn, 'roleArn');
final $request = <String, dynamic>{};
$request['DBClusterIdentifier'] = dBClusterIdentifier;
$request['RoleArn'] = roleArn;
featureName?.also((arg) => $request['FeatureName'] = arg);
await _protocol.send(
$request,
action: 'AddRoleToDBCluster',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['AddRoleToDBClusterMessage'],
shapes: shapes,
);
}