Associates an Identity and Access Management (IAM) role with an Neptune DB cluster.
Parameters:
-
db_cluster_identifier
(Optional[String], default:
None
)
–
The name of the DB cluster to associate the IAM role with.
-
role_arn
(Optional[String], default:
None
)
–
The Amazon Resource Name (ARN) of the IAM role to associate with the Neptune DB cluster, for example arn:aws:iam::123456789012:role/NeptuneAccessRole.
-
feature_name
(Optional[String], default:
None
)
–
The name of the feature for the Neptune DB cluster that the IAM role is to be associated with. For the list of supported feature names, see DBEngineVersion.
Raises:
Source code in docs_src/capo_neptune/_services/neptune.py
| def add_role_to_db_cluster(
self,
*,
config_overrides: Optional[NeptuneClientConfig] = None,
db_cluster_identifier: Optional["capo_neptune.types.string.String"] = None,
role_arn: Optional["capo_neptune.types.string.String"] = None,
feature_name: Optional["capo_neptune.types.string.String"] = None,
) -> None:
"""<p>Associates an Identity and Access Management (IAM) role with an Neptune DB cluster.</p>
Args:
db_cluster_identifier: <p>The name of the DB cluster to associate the IAM role with.</p>
role_arn: <p>The Amazon Resource Name (ARN) of the IAM role to associate with the Neptune DB cluster, for example <code>arn:aws:iam::123456789012:role/NeptuneAccessRole</code>.</p>
feature_name: <p>The name of the feature for the Neptune DB cluster that the IAM role is to be associated with. For the list of supported feature names, see <a>DBEngineVersion</a>.</p>
Raises:
capo_neptune.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <i>DBClusterIdentifier</i> does not refer to an existing DB cluster.</p>
capo_neptune.errors.db_cluster_role_already_exists_fault.DBClusterRoleAlreadyExistsFault: <p>The specified IAM role Amazon Resource Name (ARN) is already associated with the specified DB cluster.</p>
capo_neptune.errors.db_cluster_role_quota_exceeded_fault.DBClusterRoleQuotaExceededFault: <p>You have exceeded the maximum number of IAM roles that can be associated with the specified DB cluster.</p>
capo_neptune.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The DB cluster is not in a valid state.</p>
capo_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_neptune.types.add_role_to_db_cluster_message.AddRoleToDBClusterMessage]",
) -> OperationResponse[None]:
import capo_neptune._operations.amazon_rd_sv19.add_role_to_db_cluster
output, http_response = (
capo_neptune._operations.amazon_rd_sv19.add_role_to_db_cluster.add_role_to_db_cluster(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AddRoleToDBCluster")
)
input_: capo_neptune.types.add_role_to_db_cluster_message.AddRoleToDBClusterMessage = {}
if db_cluster_identifier is not None:
input_["db_cluster_identifier"] = db_cluster_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
|