Skip to content

RDS  >  Operations  >  add_role_to_db_instance

add_role_to_db_instance

Operation

add_role_to_db_instance async

add_role_to_db_instance(input: AddRoleToDBInstanceInput, plugins: list[Plugin] | None = None) -> AddRoleToDBInstanceOutput

Associates an Amazon Web Services Identity and Access Management (IAM) role with a DB instance.

Note

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.

Parameters:

Name Type Description Default
input AddRoleToDBInstanceInput

An instance of AddRoleToDBInstanceInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
AddRoleToDBInstanceOutput

An instance of AddRoleToDBInstanceOutput.

Input

AddRoleToDBInstanceInput dataclass

Bases: _SerdeShape

Dataclass for AddRoleToDBInstanceInput structure.

Attributes

db_instance_identifier class-attribute instance-attribute
db_instance_identifier: str | None = ...

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

feature_name class-attribute instance-attribute
feature_name: str | None = ...

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.

role_arn class-attribute instance-attribute
role_arn: str | None = ...

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

Output

AddRoleToDBInstanceOutput dataclass

Bases: _SerdeShape

Dataclass for AddRoleToDBInstanceOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.