AddRoleToDBInstance - Amazon Relational Database Service


Associates an AWS Identity and Access Management (IAM) role with a DB instance.


To add a role to a DB instance, the status of the DB instance must be available.

This command doesn't apply to RDS Custom.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.


The name of the DB instance to associate the IAM role with.

Type: String

Required: Yes


The name of the feature for the DB instance that the IAM role is to be associated with. For information about supported feature names, see DBEngineVersion.

Type: String

Required: Yes


The Amazon Resource Name (ARN) of the IAM role to associate with the DB instance, for example arn:aws:iam::123456789012:role/AccessRole.

Type: String

Required: Yes


For information about the errors that are common to all actions, see Common Errors.


DBInstanceIdentifier doesn't refer to an existing DB instance.

HTTP Status Code: 404


The specified RoleArn or FeatureName value is already associated with the DB instance.

HTTP Status Code: 400


You can't associate any more AWS Identity and Access Management (IAM) roles with the DB instance because the quota has been reached.

HTTP Status Code: 400


The DB instance isn't in a valid state.

HTTP Status Code: 400



This example illustrates one usage of AddRoleToDBInstance.

Sample Request ?Action=AddRoleToDBInstance &DBInstanceIdentifier=sample-instance &RoleArn=arn%3Aaws%3Aiam%3A%3A123456789012%3Arole%2Fsample-role &FeatureName=s3Import

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: