Skip to content

/AWS1/CL_RDS=>ADDROLETODBINSTANCE()

About AddRoleToDBInstance

Associates an Amazon Web Services 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.

Method Signature

IMPORTING

Required arguments:

iv_dbinstanceidentifier TYPE /AWS1/RDSSTRING /AWS1/RDSSTRING

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

iv_rolearn TYPE /AWS1/RDSSTRING /AWS1/RDSSTRING

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

iv_featurename TYPE /AWS1/RDSSTRING /AWS1/RDSSTRING

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.

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

lo_client->/aws1/if_rds~addroletodbinstance(
  iv_dbinstanceidentifier = |string|
  iv_featurename = |string|
  iv_rolearn = |string|
).

To associate an AWS Identity and Access Management (IAM) role with a DB instance

The following example adds the role to a DB instance named test-instance.

lo_client->/aws1/if_rds~addroletodbinstance(
  iv_dbinstanceidentifier = |test-instance|
  iv_featurename = |S3_INTEGRATION|
  iv_rolearn = |arn:aws:iam::111122223333:role/rds-s3-integration-role|
).