Skip to content

create_db_proxy_endpoint

create_db_proxy_endpoint(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_proxy_name: Optional[DBProxyName] = None,
    db_proxy_endpoint_name: Optional[DBProxyEndpointName] = None,
    vpc_subnet_ids: Optional[StringList] = None,
    vpc_security_group_ids: Optional[StringList] = None,
    target_role: Optional[DBProxyEndpointTargetRole] = None,
    tags: Optional[TagList] = None,
    endpoint_network_type: Optional[EndpointNetworkType] = None,
) -> CreateDBProxyEndpointResponse

Creates a DBProxyEndpoint. Only applies to proxies that are associated with Aurora DB clusters. You can use DB proxy endpoints to specify read/write or read-only access to the DB cluster. You can also use DB proxy endpoints to access a DB proxy through a different VPC than the proxy's default VPC.

Parameters:

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

    The name of the DB proxy associated with the DB proxy endpoint that you create.

  • db_proxy_endpoint_name (Optional[DBProxyEndpointName], default: None ) –

    The name of the DB proxy endpoint to create.

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

    The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet IDs than for the original DB proxy.

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

    The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of security group IDs than for the original DB proxy. The default is the default security group for the VPC.

  • target_role (Optional[DBProxyEndpointTargetRole], default: None ) –

    The role of the DB proxy endpoint. The role determines whether the endpoint can be used for read/write or only read operations. The default is READ_WRITE. The only role that proxies for RDS for Microsoft SQL Server support is READ_WRITE.

  • endpoint_network_type (Optional[EndpointNetworkType], default: None ) –

    The network type of the DB proxy endpoint. The network type determines the IP version that the proxy endpoint supports.

    Valid values:

    • IPV4 - The proxy endpoint supports IPv4 only.

    • IPV6 - The proxy endpoint supports IPv6 only.

    • DUAL - The proxy endpoint supports both IPv4 and IPv6.

    Default: IPV4

    Constraints:

    • If you specify IPV6 or DUAL, the VPC and all subnets must have an IPv6 CIDR block.

    • If you specify IPV6 or DUAL, the VPC tenancy cannot be dedicated.

Raises:

  • DBProxyEndpointAlreadyExistsFault –

    The specified DB proxy endpoint name must be unique for all DB proxy endpoints owned by your Amazon Web Services account in the specified Amazon Web Services Region.

  • DBProxyEndpointQuotaExceededFault –

    The DB proxy already has the maximum number of endpoints.

  • DBProxyNotFoundFault –

    The specified proxy name doesn't correspond to a proxy owned by your Amazon Web Services account in the specified Amazon Web Services Region.

  • InvalidDBProxyStateFault –

    The requested operation can't be performed while the proxy is in this state.

  • InvalidSubnet –

    The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_rds/_services/rds.py
def create_db_proxy_endpoint(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_proxy_name: Optional["capo_rds.types.db_proxy_name.DBProxyName"] = None,
    db_proxy_endpoint_name: Optional[
        "capo_rds.types.db_proxy_endpoint_name.DBProxyEndpointName"
    ] = None,
    vpc_subnet_ids: Optional["capo_rds.types.string_list.StringList"] = None,
    vpc_security_group_ids: Optional[
        "capo_rds.types.string_list.StringList"
    ] = None,
    target_role: Optional[
        "capo_rds.types.db_proxy_endpoint_target_role.DBProxyEndpointTargetRole"
    ] = None,
    tags: Optional["capo_rds.types.tag_list.TagList"] = None,
    endpoint_network_type: Optional[
        "capo_rds.types.endpoint_network_type.EndpointNetworkType"
    ] = None,
) -> (
    "capo_rds.types.create_db_proxy_endpoint_response.CreateDBProxyEndpointResponse"
):
    """<p>Creates a <code>DBProxyEndpoint</code>. Only applies to proxies that are associated with Aurora DB clusters. You can use DB proxy endpoints to specify read/write or read-only access to the DB cluster. You can also use DB proxy endpoints to access a DB proxy through a different VPC than the proxy's default VPC.</p>

    Args:
        db_proxy_name: <p>The name of the DB proxy associated with the DB proxy endpoint that you create.</p>
        db_proxy_endpoint_name: <p>The name of the DB proxy endpoint to create.</p>
        vpc_subnet_ids: <p>The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet IDs than for the original DB proxy.</p>
        vpc_security_group_ids: <p>The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of security group IDs than for the original DB proxy. The default is the default security group for the VPC.</p>
        target_role: <p>The role of the DB proxy endpoint. The role determines whether the endpoint can be used for read/write or only read operations. The default is <code>READ_WRITE</code>. The only role that proxies for RDS for Microsoft SQL Server support is <code>READ_WRITE</code>.</p>
        endpoint_network_type: <p>The network type of the DB proxy endpoint. The network type determines the IP version that the proxy endpoint supports.</p> <p>Valid values:</p> <ul> <li> <p> <code>IPV4</code> - The proxy endpoint supports IPv4 only.</p> </li> <li> <p> <code>IPV6</code> - The proxy endpoint supports IPv6 only.</p> </li> <li> <p> <code>DUAL</code> - The proxy endpoint supports both IPv4 and IPv6.</p> </li> </ul> <p>Default: <code>IPV4</code> </p> <p>Constraints:</p> <ul> <li> <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC and all subnets must have an IPv6 CIDR block.</p> </li> <li> <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC tenancy cannot be <code>dedicated</code>.</p> </li> </ul>

    Raises:
        capo_rds.errors.db_proxy_endpoint_already_exists_fault.DBProxyEndpointAlreadyExistsFault: <p>The specified DB proxy endpoint name must be unique for all DB proxy endpoints owned by your Amazon Web Services account in the specified Amazon Web Services Region.</p>
        capo_rds.errors.db_proxy_endpoint_quota_exceeded_fault.DBProxyEndpointQuotaExceededFault: <p>The DB proxy already has the maximum number of endpoints.</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.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.invalid_subnet.InvalidSubnet: <p>The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.create_db_proxy_endpoint_request.CreateDBProxyEndpointRequest]",
    ) -> OperationResponse[
        "capo_rds.types.create_db_proxy_endpoint_response.CreateDBProxyEndpointResponse"
    ]:
        import capo_rds._operations.amazon_rd_sv19.create_db_proxy_endpoint

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDBProxyEndpoint")
    )
    input_: capo_rds.types.create_db_proxy_endpoint_request.CreateDBProxyEndpointRequest = {}
    if db_proxy_name is not None:
        input_["db_proxy_name"] = db_proxy_name
    if db_proxy_endpoint_name is not None:
        input_["db_proxy_endpoint_name"] = db_proxy_endpoint_name
    if vpc_subnet_ids is not None:
        input_["vpc_subnet_ids"] = vpc_subnet_ids
    if vpc_security_group_ids is not None:
        input_["vpc_security_group_ids"] = vpc_security_group_ids
    if target_role is not None:
        input_["target_role"] = target_role
    if tags is not None:
        input_["tags"] = tags
    if endpoint_network_type is not None:
        input_["endpoint_network_type"] = endpoint_network_type

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