Documentation Index
Fetch the complete documentation index at: https://docs.gateways.app/llms.txt
Use this file to discover all available pages before exploring further.
Database Endpoints
GatewaysApp supports managed relational databases on AWS RDS and GCP Cloud SQL. The create endpoint uses the project’s connected cloud (AWS or GCP). AWS: MySQL, PostgreSQL, MariaDB with DB subnet group and security group. GCP: MySQL and PostgreSQL only (no MariaDB); Cloud SQL with automatic configuration.Create Database
POST /api/:projectSlug/:environmentSlug/databases- Create a new database (AWS RDS or GCP Cloud SQL)
instanceClass as Cloud SQL tier (e.g. db-f1-micro, db-g1-small) or AWS-like (db.t3.micro → db-f1-micro); database-versions (with environmentSlug) and database-instance-types use the project’s connected cloud (use provider=gcp or rely on project’s connected cloud).
GCP private IP (default): When publiclyAccessible is false (the default), Cloud SQL is created with private IP only on the default VPC (ipv4Enabled: false, privateNetwork set). Instances, scalable servers, and functions (with VPC connector) connect over the private network without public authorized-network rules. Set publiclyAccessible: true only if you need a public IPv4 address (and broad authorized network for dev). Private IP requires a working Service Networking / private services access connection for the VPC; if create fails, enable the Service Networking API and ensure the VPC can allocate a peering range (see GCP “Private IP” docs).
Request Body:
- DB instance identifier will be sanitized to meet AWS requirements (1-63 characters, alphanumeric and hyphens only)
- The name you provide will be used directly as the AWS RDS instance identifier
- Automatically converted to lowercase
- Invalid characters replaced with hyphens
- Must contain at least one alphanumeric character
mysql- MySQL (default port: 3306)postgres- PostgreSQL (default port: 5432)mariadb- MariaDB (default port: 3306)
-
Get Available Database Types:
Returns all supported database engine types (MySQL, PostgreSQL, MariaDB, etc.). Requires auth.
-
Get Available Engine Versions:
Returns available engine versions. Use
provider=awsfor RDS (optionallyregion); useprovider=gcpfor Cloud SQL (enginefilter;metadata.gcpDatabaseVersione.g. MYSQL_8_0, POSTGRES_15). Requires auth. -
Get Available Instance Types:
Returns RDS instance types (AWS) or Cloud SQL tiers (GCP: db-f1-micro, db-n1-standard-*, etc.). Provider can be inferred from the project’s connected cloud. Requires auth.
-
Get Available Volume Types:
Returns available RDS volume types (gp2, gp3, io1, io2) with pricing and storage limits. Provider is inferred from the project’s cloud connection. Requires auth.
- storageType (optional): Storage type for the database
- AWS RDS:
gp2,gp3,io1,io2(default:gp3)gp2/gp3(General Purpose SSD): Minimum 20 GBio1/io2(Provisioned IOPS SSD): Minimum 100 GB
- GCP Cloud SQL: Uses default storage type (not configurable via API)
- Azure: Uses default storage type (not configurable via API)
- AWS RDS:
- If not provided, defaults to
gp3for AWS RDS - To check available volume types and pricing for your region, use:
GET /api/cloud/:projectSlug/volume-types?region=us-east-1&resource_type=rds(auth required; provider from project connection)
- Security: Username and password are encrypted and stored securely in the
secret_datacolumn. They are never returned in API responses. - Metadata Fields: The following fields are automatically stored in the
metadatacolumn:volumeType: Storage type (e.g., gp2, gp3, io1, io2 for AWS RDS) - looked up from database instance typesstorageSize: Allocated storage in GB (same asallocatedStorage)vcpus: Number of vCPUs - looked up from database instance types tablememoryGb: Memory in GB - looked up from database instance types tablepricePerHour: Estimated hourly price - looked up from database instance type pricing table
- RDS instances can take several minutes to create and become available
- The API returns immediately with status “creating”
- Use the sync endpoint or AWS Console to check creation progress
- Requires subnets in at least 2 availability zones (automatically handled via default VPC)
- DB subnet groups are automatically created and reused per project/environment
endpoint field will be null initially and will be populated once the database instance is available. Use the describe endpoint or AWS Console to check when the endpoint becomes available.
Error Response (No cloud connection):
List Databases
GET /api/:projectSlug/:environmentSlug/databases- List all databases for a project environment
- None (filtering is handled by project/environment slugs in the path)
creating- Database instance is being createdavailable- Database instance is available and ready to accept connectionsbacking-up- Database instance is currently being backed upmodifying- Database instance is being modifieddeleting- Database instance is being deleteddeleted- Database instance has been deleted- Other AWS RDS status values may also appear
Get Database Details
GET /api/:projectSlug/:environmentSlug/databases/:id- Get details of a specific database
id- Database database ID (not AWS resource ID)
Sync Database Status from Cloud Provider
Note: Database sync is now performed through the unified resources API. Use the unified sync endpoint instead of the type-specific endpoint. Unified Sync Endpoint:PUT /api/:projectSlug/:environmentSlug/resources/:resourceId/sync
See Resources API — Sync Resource from Cloud Provider for details.
Description:
- Fetches the latest database details from the cloud provider (AWS RDS, GCP Cloud SQL, or Azure Flexible Server)
- Updates the database record with current status, endpoint, port, allocated storage, instance class, multi-AZ, and publicly accessible settings
- Updates engine version if it has changed
- Handles deleted databases (updates status to ‘deleted’ if not found in the cloud provider)
- Fetches the latest database details from the cloud provider
- Updates the database record with current status, endpoint, port, allocated storage, instance class, multi-AZ, and publicly accessible settings
- Updates engine version if it has changed
- Handles deleted databases (updates status to ‘deleted’ if not found in the cloud provider)
Get Database Pulse/Metrics
GET /api/:projectSlug/:environmentSlug/databases/:id/pulse- Get database metrics (CPU, connections, memory, storage, I/O, network)
- AWS only. Fetches real-time and historical metrics from AWS CloudWatch for RDS. For GCP Cloud SQL, returns 501 Not Implemented.
- Returns CPU utilization, database connections, memory, storage, read/write latency, IOPS, and network throughput
- Supports custom time ranges and aggregation periods
id- Database database ID (not AWS resource ID)
startTime(optional): ISO 8601 timestamp for start time (default: 1 hour ago)endTime(optional): ISO 8601 timestamp for end time (default: now)period(optional): Period in seconds for metric aggregation (default: 300 = 5 minutes, minimum: 60)
- cpu: CPU utilization percentage (0-100%)
- connections: Number of active database connections
- memory: Freeable memory in bytes
- storage: Free storage space in bytes
- readLatency: Average read latency in seconds
- writeLatency: Average write latency in seconds
- readIOPS: Read IOPS (Input/Output Operations Per Second)
- writeIOPS: Write IOPS
- networkReceive: Network receive throughput in bytes/second
- networkTransmit: Network transmit throughput in bytes/second
- Metrics are fetched from AWS CloudWatch
- If a metric has no data for the specified time range, it will be
null - The
datapointsarray contains time-series data points for charting - Default time range is the last 1 hour with 5-minute aggregation periods
- Minimum period is 60 seconds (1 minute)
Delete Database
Database deletion is performed only via the unified resources API:DELETE /api/:projectSlug/:environmentSlug/resources/:resourceId
Database Connection
Once a database is created and its status becomesavailable, you can connect to it using:
- Endpoint: The
endpointfield in the database response - Port: The
portfield (3306 for MySQL/MariaDB, 5432 for PostgreSQL) - Username: The
masterUsernameyou provided during creation - Password: The
masterUserPasswordyou provided during creation
Database in Unified Resources API
Databases are also included in the unified resources API endpoints:List All Resources (includes databases)
GET /api/:projectSlug/:environmentSlug/resources- See Resources API DocumentationGET /api/:projectSlug/:environmentSlug/resources- See Resources API Documentation
Get Database via Resources API
GET /api/:projectSlug/:environmentSlug/resources/:resourceId- Get database details via unified resources API (use database’s resource ID)
Database Position Updates
Database positions can be updated using the resource positions API:PATCH /api/:projectSlug/:environmentSlug/resources/:resourceId/position- See Resource Positions API Documentation
Database Features
Default Security Group
- Databases use the default security group for the project/environment
- If the default security group doesn’t exist, it’s created automatically
- Security group name format:
GatewaysApp-Default-{projectSlug}-{environmentSlug} - Default security group allows all inbound traffic (0.0.0.0/0)
- Important: You may need to add specific rules to allow database connections on the database port (3306 for MySQL/MariaDB, 5432 for PostgreSQL)
DB Subnet Group
- A DB subnet group is automatically created when a database is created
- DB subnet group name format:
gateways-{projectSlug}-{environmentSlug} - Requires subnets in at least 2 availability zones
- Uses subnets from the default VPC
- DB subnet groups are reused per project/environment to avoid duplication
Engine Support
- MySQL: Full support for MySQL engine versions
- PostgreSQL: Full support for PostgreSQL engine versions
- MariaDB: Full support for MariaDB engine versions
Multi-AZ Deployment
- Multi-AZ deployment provides high availability and automatic failover
- When enabled, RDS automatically creates a standby instance in a different availability zone
- Available for all supported engines
- Increases cost (approximately 2x) but provides better reliability
Public Accessibility
- When enabled, the database endpoint is accessible from the internet
- When disabled, the database is only accessible from within the VPC
- For production use, it’s recommended to disable public accessibility and connect from within the VPC
Requirements
- AWS Connection: The project must have an active AWS cloud connection
- Region: A valid AWS region code must be provided (e.g.,
us-east-1,eu-west-1,ap-south-1)- The region code format is validated (must match AWS region pattern)
- AWS will further validate the region when creating the database
- Default VPC: The AWS account must have a default VPC in the specified region
- Subnets: At least 2 subnets in different Availability Zones are required for DB subnet groups
- AWS SDK Package: The
@aws-sdk/client-rdspackage must be installed (included by default) - CloudFormation Permissions: The CloudFormation stack must include RDS permissions
Error Handling
Common Errors
1. No Cloud Connection:Notes
- Database creation can take several minutes (typically 5-15 minutes depending on instance class and Multi-AZ configuration)
- The API returns immediately with status “creating”
- Use the describe endpoint or AWS Console to check creation progress
- Once available, the endpoint field will contain the connection endpoint
- DB subnet groups are automatically managed and reused per project/environment
- Security groups can be customized via the firewall resource type and resource connections
- Position coordinates allow for canvas-based UI visualization
- Database deletion creates a final snapshot automatically
Related APIs
For querying available database configurations before creating a database:- Database Types:
GET /api/cloud/:projectSlug/database-types- List all supported database engine types (auth) - Database Versions:
GET /api/cloud/:projectSlug/:environmentSlug/database-versions- List available database engines and versions (uses project’s connected cloud; auth) - Database Instance Types:
GET /api/cloud/:projectSlug/database-instance-types- List available RDS instance types with specifications (auth)