Skip to content

remove_role_from_db_instance

remove_role_from_db_instance(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional[String] = None,
    role_arn: Optional[String] = None,
    feature_name: Optional[String] = None,
) -> None

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

Parameters:

  • db_instance_identifier (Optional[String], default: None ) –

    The name of the DB instance to disassociate the IAM role from.

  • role_arn (Optional[String], default: None ) –

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

  • feature_name (Optional[String], default: None ) –

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

Raises:

Source code in docs_src/capo_rds/_services/rds.py
def remove_role_from_db_instance(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional["capo_rds.types.string.String"] = None,
    role_arn: Optional["capo_rds.types.string.String"] = None,
    feature_name: Optional["capo_rds.types.string.String"] = None,
) -> None:
    """<p>Disassociates an Amazon Web Services Identity and Access Management (IAM) role from a DB instance.</p>

    Args:
        db_instance_identifier: <p>The name of the DB instance to disassociate the IAM role from.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of the IAM role to disassociate from the DB instance, for example, <code>arn:aws:iam::123456789012:role/AccessRole</code>.</p>
        feature_name: <p>The name of the feature for the DB instance that the IAM role is to be disassociated from. For information about supported feature names, see <code>DBEngineVersion</code>.</p>

    Raises:
        capo_rds.errors.db_instance_not_found_fault.DBInstanceNotFoundFault: <p> <code>DBInstanceIdentifier</code> doesn't refer to an existing DB instance.</p>
        capo_rds.errors.db_instance_role_not_found_fault.DBInstanceRoleNotFoundFault: <p>The specified <code>RoleArn</code> value doesn't match the specified feature for the DB instance.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.remove_role_from_db_instance_message.RemoveRoleFromDBInstanceMessage]",
    ) -> OperationResponse[None]:
        import capo_rds._operations.amazon_rd_sv19.remove_role_from_db_instance

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.remove_role_from_db_instance.remove_role_from_db_instance(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemoveRoleFromDBInstance")
    )
    input_: capo_rds.types.remove_role_from_db_instance_message.RemoveRoleFromDBInstanceMessage = {}
    if db_instance_identifier is not None:
        input_["db_instance_identifier"] = db_instance_identifier
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if feature_name is not None:
        input_["feature_name"] = feature_name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output