Skip to content

register_db_proxy_targets

register_db_proxy_targets(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_proxy_name: Optional[DBProxyName] = None,
    target_group_name: Optional[DBProxyTargetGroupName] = None,
    db_instance_identifiers: Optional[StringList] = None,
    db_cluster_identifiers: Optional[StringList] = None,
) -> RegisterDBProxyTargetsResponse

Associate one or more DBProxyTarget data structures with a DBProxyTargetGroup.

Parameters:

  • db_proxy_name (Optional[DBProxyName], default: None ) –

    The identifier of the DBProxy that is associated with the DBProxyTargetGroup.

  • target_group_name (Optional[DBProxyTargetGroupName], default: None ) –

    The identifier of the DBProxyTargetGroup.

  • db_instance_identifiers (Optional[StringList], default: None ) –

    One or more DB instance identifiers.

  • db_cluster_identifiers (Optional[StringList], default: None ) –

    One or more DB cluster identifiers.

Raises:

Source code in docs_src/capo_rds/_services/rds.py
def register_db_proxy_targets(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_proxy_name: Optional["capo_rds.types.db_proxy_name.DBProxyName"] = None,
    target_group_name: Optional[
        "capo_rds.types.db_proxy_target_group_name.DBProxyTargetGroupName"
    ] = None,
    db_instance_identifiers: Optional[
        "capo_rds.types.string_list.StringList"
    ] = None,
    db_cluster_identifiers: Optional[
        "capo_rds.types.string_list.StringList"
    ] = None,
) -> "capo_rds.types.register_db_proxy_targets_response.RegisterDBProxyTargetsResponse":
    """<p>Associate one or more <code>DBProxyTarget</code> data structures with a <code>DBProxyTargetGroup</code>.</p>

    Args:
        db_proxy_name: <p>The identifier of the <code>DBProxy</code> that is associated with the <code>DBProxyTargetGroup</code>.</p>
        target_group_name: <p>The identifier of the <code>DBProxyTargetGroup</code>.</p>
        db_instance_identifiers: <p>One or more DB instance identifiers.</p>
        db_cluster_identifiers: <p>One or more DB cluster identifiers.</p>

    Raises:
        capo_rds.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
        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_proxy_not_found_fault.DBProxyNotFoundFault: <p>The specified proxy name doesn't correspond to a proxy owned by your Amazon Web Services account in the specified Amazon Web Services Region.</p>
        capo_rds.errors.db_proxy_target_already_registered_fault.DBProxyTargetAlreadyRegisteredFault: <p>The proxy is already associated with the specified RDS DB instance or Aurora DB cluster.</p>
        capo_rds.errors.db_proxy_target_group_not_found_fault.DBProxyTargetGroupNotFoundFault: <p>The specified target group isn't available for a proxy owned by your Amazon Web Services account in the specified Amazon Web Services Region.</p>
        capo_rds.errors.insufficient_available_i_ps_in_subnet_fault.InsufficientAvailableIPsInSubnetFault: <p>The requested operation can't be performed because there aren't enough available IP addresses in the proxy's subnets. Add more CIDR blocks to the VPC or remove IP address that aren't required from the subnets.</p>
        capo_rds.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.invalid_db_proxy_state_fault.InvalidDBProxyStateFault: <p>The requested operation can't be performed while the proxy is in this state.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.register_db_proxy_targets_request.RegisterDBProxyTargetsRequest]",
    ) -> OperationResponse[
        "capo_rds.types.register_db_proxy_targets_response.RegisterDBProxyTargetsResponse"
    ]:
        import capo_rds._operations.amazon_rd_sv19.register_db_proxy_targets

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RegisterDBProxyTargets")
    )
    input_: capo_rds.types.register_db_proxy_targets_request.RegisterDBProxyTargetsRequest = {}
    if db_proxy_name is not None:
        input_["db_proxy_name"] = db_proxy_name
    if target_group_name is not None:
        input_["target_group_name"] = target_group_name
    if db_instance_identifiers is not None:
        input_["db_instance_identifiers"] = db_instance_identifiers
    if db_cluster_identifiers is not None:
        input_["db_cluster_identifiers"] = db_cluster_identifiers

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